home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacTech 1 to 12
/
MacTech-vol-1-12.toast
/
Reference
/
the cmsp digests ('94-'97)
/
csmp digest Vol 4 No 027
< prev
next >
Wrap
Text File
|
1996-12-03
|
135KB
|
3,703 lines
C.S.M.P. Digest Mon, 02 Dec 96 Volume 4 : Issue 27
Today's Topics:
?? Sound Manager freqCmd question
Apple telephony and Apple events
AppleScript command always crashing
Custom Appletalk driver to tunnel through TCP-IP
Detecting the Scriptable Finder reliably?
Drag gray rgn
How Do I Disable Power Key?
How do I convert a creator and file type???????
How to get the "kind" of a file
Mac C help-Random
MacOS Printing Bug!
OOP vs Structured style WAS: Re: Reasons for bloat?
Question: NewGWorld call returns error -108
Reasons for bloat?
Writing Netscape Plugins...How ?
[Q] AppleScript Variable
[Q] Difference between MOVE.L and MOVEA.L
[Q] Hiding Applications
[Q] How to tell if you're "hidden"?
[Q] forcing updateEvts & turning a font question
cicn-ICON conundrum (cicn != 32x32 == UGLY!)
mac batch file conversion
scrolling game help
where find routines for MacTCP connections?
The Comp.Sys.Mac.Programmer Digest is moderated by Mark Aiken
(marka@ee.mcgill.ca).
The digest is a collection of article threads from the internet
newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
csmp.games. It is designed for people who read news semi-regularly and
want an archive of the discussions. If you don't know what a
newsgroup is, you probably don't have access to it. Ask your systems
administrator(s) for details. If you don't have access to news, you
may still be able to post messages to the group by using a mail server
like anon.penet.fi (mail help@anon.penet.fi for more information).
Each issue of the digest contains one or more sets of articles (called
threads), with each set corresponding to a 'discussion' of a particular
subject. The articles are not edited; all articles included in this digest
are in their original posted form (as received by our news server at
ee.mcgill.ca). Article threads are not added to the digest until the last
article added to the thread is at least two weeks old (this is to ensure that
the thread is dead before adding it to the digest). Article threads that
consist of only one message are generally not included in the digest.
The digests can be obtained by email, ftp or through the World Wide Web.
If you want to receive the digest by mail, send email to
majordomo@ee.mcgill.ca with no subject and one of the following commands
as body:
help Sends you a summary of commands
subscribe csmp Adds you to the mailing list
unsubscribe csmp Removes you from the list
Once you have subscribed, you will automatically receive each new
issue as it is created.
Back issues are available by ftp from Info-Mac mirror sites in the
per/csmp subdirectory, e.g.
ftp://sumex-aim.stanford.edu/info-mac/per/csmp/
The contents of all back issues can be searched by accessing the
following URL, courtesy of Andrew Barry (ajbarry@ozemail.com.au):
http://marvin.stattech.com.au/search.html
They can also be searched through the following URLs, thanks to
Tim Tuck (Tim.Tuck@sensei.com.au):
http://wais.sensei.com.au/searchform.html
wais://wais.sensei.com.au:210/csmp?
-------------------------------------------------------
>From heaney@crl.com (John S. Heaney)
Subject: ?? Sound Manager freqCmd question
Date: 14 Nov 1996 12:37:49 -0800
Organization: CRL Dialup Internet Access (415) 705-6060 [Login: guest]
I'm using the freqCmd to loop a sample sound stored as a 'snd ' resource
so I can play it for an arbitrarily long time (until I stop it). I've set
it up according to what I read in IM: Sound. I'm having one problem,
though. The freqCmd takes a frequency parameter. The documentation says,
"If you are playing a sampled sound, however, you can modify the
sampleRate field of the sound header to play a sound at an arbitrary
frequency. To do so, use the following formula:
new sample rate = (new frequency / original frequency) * original sample rate
where the new and original frequencies are measured in hertz."
This doesn't refer to the frequency paramter, but rather, to the sample
rate, the field in the sound header, I imagine. Anyway, I don't really
care about this because I want to play the sound at it's normal rate and
frequency (the sound isn't a note, it's a musical phrase). I tried using 1
for the frequency and that comes the closest to being correct, but it's a
little bit fast--a little higher frequency. If I use 0 then I get no
sound. Since this doesn't seem to be a Fixed type, I can't enter something
less than 1.
Does anyone know how I determine what values I'm supposed to use? I just
want the sound to play at it's normal rate and frequency.
--
John Heaney Time flies whether you're having fun or not.
heaney@crl.com
+++++++++++++++++++++++++++
>From heaney@crl.com (John S. Heaney)
Date: 14 Nov 1996 16:18:22 -0800
Organization: CRL Dialup Internet Access (415) 705-6060 [Login: guest]
In article <56fvut$88j@crl7.crl.com>, John S. Heaney <heaney@crl.com> wrote:
>
>I'm using the freqCmd to loop a sample sound stored as a 'snd ' resource
>so I can play it for an arbitrarily long time (until I stop it). I've set
>it up according to what I read in IM: Sound. I'm having one problem,
>though. The freqCmd takes a frequency parameter. The documentation says,
>
>"If you are playing a sampled sound, however, you can modify the
>sampleRate field of the sound header to play a sound at an arbitrary
>frequency. To do so, use the following formula:
>
>new sample rate = (new frequency / original frequency) * original sample rate
>
>where the new and original frequencies are measured in hertz."
>
>This doesn't refer to the frequency paramter, but rather, to the sample
>rate, the field in the sound header, I imagine. Anyway, I don't really
>care about this because I want to play the sound at it's normal rate and
>frequency (the sound isn't a note, it's a musical phrase). I tried using 1
>for the frequency and that comes the closest to being correct, but it's a
>little bit fast--a little higher frequency. If I use 0 then I get no
>sound. Since this doesn't seem to be a Fixed type, I can't enter something
>less than 1.
>
>Does anyone know how I determine what values I'm supposed to use? I just
>want the sound to play at it's normal rate and frequency.
Just to add a little more information...I tried leaving the frequency
parameter at 1 and changing the sample rate to a lower number. If I set
the rate to 19/20ths of the rate stored in the file then it seems to work
at just the right speed and frequency. Unfortunately, there is some
audible distortion. Is there something magic about 19/20? Is there some
other way I can make this adjustment without the distortion?
Thanks.
--
John Heaney Time flies whether you're having fun or not.
heaney@crl.com
+++++++++++++++++++++++++++
>From heaney@crl.com (John S. Heaney)
Date: 15 Nov 1996 13:56:14 -0800
Organization: CRL Dialup Internet Access (415) 705-6060 [Login: guest]
In article <56fvut$88j@crl7.crl.com>, John S. Heaney <heaney@crl.com> wrote:
>
>I'm using the freqCmd to loop a sample sound stored as a 'snd ' resource
>so I can play it for an arbitrarily long time (until I stop it). I've set
>it up according to what I read in IM: Sound. I'm having one problem,
>though. The freqCmd takes a frequency parameter. The documentation says,
>
>"If you are playing a sampled sound, however, you can modify the
>sampleRate field of the sound header to play a sound at an arbitrary
>frequency. To do so, use the following formula:
>
>new sample rate = (new frequency / original frequency) * original sample rate
>
>where the new and original frequencies are measured in hertz."
I got it figured out. The trick is to write a frequency into the
baseFrequency field of the sound header. Then you use the same frequency
in the freqCmd.
Thanks to Michael Kluev for giving me the hint that set me down the right
path.
--
John Heaney Time flies whether you're having fun or not.
heaney@crl.com
+++++++++++++++++++++++++++
>From Jackson Software Development <development@jacksoncorp.com>
Date: 15 Nov 1996 14:43:37 GMT
Organization: Jackson Software
In article <56gcse$rrg@crl11.crl.com> John S. Heaney, heaney@crl.com
writes:
>>Does anyone know how I determine what values I'm supposed to use? I just
>>want the sound to play at it's normal rate and frequency.
The 2nd parameter should be the MIDI note number, according to Think Ref.
I think that you can get the MIDI note number from the 'snd ' resource
header. It should be a number between 1 and 128.
Darrin
---------------------------
>From ajmas@worldnet.fr (Andre-John Mas)
Subject: Apple telephony and Apple events
Date: Sat, 9 Nov 1996 17:47:22 +0100
Organization: SCT / Worldnet - Internet Provider & Information Exchange - Paris, France
I am wanting to add a telephone dialing capability to one of my programs
and possibly support a few Apple Events. What I am wanting to know, is
first what Apple Events are there associated with telephony and whether
I should make the dialing operation to my program and dial using an
external dialing program via Apple Events.
Otherwise, if I created a application spefic AE, such as DIAL that
accepts a number for the telephone number, would it be just as good?
e.g. DIAL with number 003393276780
Andre-John
+++++++++++++++++++++++++++
>From andyb@apple.com (Andy Bachorski)
Date: Mon, 18 Nov 1996 18:05:04 -0800
Organization: Apple Computer, Inc.
In article <19961109174722932313@nice0-146.sct.fr>, ajmas@worldnet.fr
(Andre-John Mas) wrote:
> I am wanting to add a telephone dialing capability to one of my programs
> and possibly support a few Apple Events. What I am wanting to know, is
> first what Apple Events are there associated with telephony and whether
> I should make the dialing operation to my program and dial using an
> external dialing program via Apple Events.
> Otherwise, if I created a application spefic AE, such as DIAL that
The telephony suite specification was released recently, and can be found at
<ftp://ftpdev.info.apple.com/Developer_Services/./Technical_Documentation/Apple_Events_Registry_-_Suites/AE_Suite_-_Telephony.sit.hqx>
It should answer most of your questions about what events you'll need to
support. And if it doesn't, ask more questions. ;)
Andy Bachorski - andyb@apple.com
---------------------------
>From jc@or.psychology.dal.ca (John Christie)
Subject: AppleScript command always crashing
Date: 14 Nov 1996 16:45:09 GMT
Organization: ISINet, Nova Scotia
Hi
I find that there are certain AppleScript commands that always
return an error for me. I am not certain what they are supposed to do.
They are always bounded by << and >> and include "ae" (aevt?) at the
beginning of one of the words. Anyone know what the problem is?
--
- ----------------------------------------------------------------
John Christie
"You aren't free because you CAN choose - only if you DO choose."
"All you are is the decisions you make. If you let circumstances make
them for you then what you are becomes very easy to estimate."
+++++++++++++++++++++++++++
>From uzs90z@uni-bonn.de (Michael Schuerig)
Date: Fri, 15 Nov 1996 03:48:46 +0100
Organization: RHRZ - University of Bonn (Germany)
John Christie <jc@or.psychology.dal.ca> wrote:
> I find that there are certain AppleScript commands that always
> return an error for me. I am not certain what they are supposed to do.
> They are always bounded by << and >> and include "ae" (aevt?) at the
> beginning of one of the words. Anyone know what the problem is?
First of all, you are not crashing, you get orderly error messages.
The bracketed stuff simply means that AppleScript doesn't know how to
present the internal codes to you as applications and/or scripting
additions that are required to execute the script are missing.
Tell us what's inside the brackets, maybe we can tell you which
apps/additions you need.
Michael
- -
Michael Schuerig
mailto:uzs90z@uni-bonn.de
http://www.rhrz.uni-bonn.de/~uzs90z/
+++++++++++++++++++++++++++
>From jwbaxter@olympus.net (John W. Baxter)
Date: Thu, 14 Nov 1996 18:36:48 -0800
Organization: Internet for the Olympic Peninsula
In article <56fial$fkb@News.Dal.Ca>, jc@or.psychology.dal.ca (John
Christie) wrote:
>Hi
> I find that there are certain AppleScript commands that always
>return an error for me. I am not certain what they are supposed to do.
>They are always bounded by << and >> and include "ae" (aevt?) at the
>beginning of one of the words. Anyone know what the problem is?
>
Almost always, those problems result from a Scripting Addition which was
present when the script was compiled not being present when the script is
executed. When you open the script with an editor, it is decompiled using
the available terminology...the guillemots (angle bracke pairs,
"chevrons") are the syntax for a thing (event in this case, classes and
some other possibilities also) with no terminology. Scripting Additions
supply terminology in addition to function.
[You can achieve the same effect by removing the terminology resource from
an application used in the script's tell statements, but that's almost
never the cause unintentionally...it could be the cause if an older
(pre-scriptable) version of the app is present on the machine and the
right version isn't, if you've moved the script.]
--John
--
The primary cause of problems is solutions.
John W. Baxter Port Ludlow, WA, USA jwbaxter@olympus.net
---------------------------
>From Paul Cantrell <pcantrell@macalester.edu>
Subject: Custom Appletalk driver to tunnel through TCP-IP
Date: Mon, 18 Nov 1996 12:36:39 -0600
Organization: The Red-Headed League
I have a machine on a local internet, and I'd like to give it access
to an Appletalk network. It seems that I should be able to write a
custom Appletalk driver which would simply bundle Appletalk packets into
TCP/IP packets, send them via Internet to a machine on the actual
Appletalk network, which would unbundle the packets and pop them into
Appletalk.
Does anybody know--
(1) Does something like this already exist?
(2) If not, where can I get docs on writing a custom Appletalk driver?
Cheers,
Paul
pcantrell@macalester.edu
P.S. Please respond via e-mail if possible, since I don't really
frequent these groups as I used to... <:|
+++++++++++++++++++++++++++
>From Goran Larsson <goran.larsson@macexchange.se>
Date: Mon, 18 Nov 1996 23:21:46 +0100
Organization: The Open Gate BBS
Paul Cantrell wrote:
>
> I have a machine on a local internet, and I'd like to give it access
> to an Appletalk network. It seems that I should be able to write a
> custom Appletalk driver which would simply bundle Appletalk packets into
> TCP/IP packets, send them via Internet to a machine on the actual
> Appletalk network, which would unbundle the packets and pop them into
> Appletalk.
>
> Does anybody know--
>
> (1) Does something like this already exist?
Yeah in form of software (TCP Serial) which expands the ARA to IP
networks or ARNS (A Remote Network Server. I'm sorry but I don't have
the link to it any longer. Try searching the Macintouch home page at
www.macintouch.com for it I remember seeing something about it earlier
this fall.
And of course in hardware. I recommend that you get two Gator box CS
from Cayman and creates a Appletalk tunnel over the IP beetween these.
For more info check out www.cayman.com.
Regards
Goran Larsson
+++++++++++++++++++++++++++
>From jude@smellycat.com (Jude Giampaolo)
Date: Mon, 18 Nov 1996 17:22:16 -0500
Organization: CyberDrugs
In article <3290ACB7.6797@macalester.edu>, Paul Cantrell
<pcantrell@macalester.edu> wrote:
> I have a machine on a local internet, and I'd like to give it access
> to an Appletalk network. It seems that I should be able to write a
> custom Appletalk driver which would simply bundle Appletalk packets into
> TCP/IP packets, send them via Internet to a machine on the actual
> Appletalk network, which would unbundle the packets and pop them into
> Appletalk.
Yup, you may want to take a look at:
http://www.cs.mu.OZ.AU/appletalk/doc/MacUAR.userDoc
Does IP tunneling ad much more.
Please note followups.....
--
Jude Charles Giampaolo 'I was lined up for glory, but the
jcg161@psu.edu tickets sold out in advance'
jude@smellycat.com http://prozac.cwru.edu/jude/JudeHome.html
---------------------------
>From marka@ee.mcgill.ca (Mark Aiken)
Subject: Detecting the Scriptable Finder reliably?
Date: Fri, 15 Nov 1996 18:37:10 -0500
Organization: Will Hack for Food
Hello all,
I have a shareware application that relies on the Scriptable Finder
(full-blown object model support, not the wimpy scripting in some previous
releases of the Finder). I am currently testing for its presence by
testing the gestaltOSLCompliantFinder bit of the response to a Gestalt
query with gestaltFinderAttr. My code is below.
I have had several complaints that my app will refuse to run on the
grounds that the Scriptable Finder is not present on certain machines.
These people are often running System 7.5.5 or some other release that
incorporates the Scriptable Finder, or can locate the "Finder Scripting
Extension" in their Extensions folder.
Is there a known problem with this Gestalt bit? Should I be testing
some other way? Enlightenment appreciated. Here is my code:
Boolean FinderIsScriptable()
{
long Response;
OSErr Error;
if((Error = Gestalt(gestaltFinderAttr, &Response)) != noErr)
return(false);
if(!BitTst(&Response, 31-gestaltOSLCompliantFinder))
return(false);
return true;
}
Mark Aiken
Shareware author
marka@kagi.com
+++++++++++++++++++++++++++
>From jumplong@aol.com
Date: 17 Nov 1996 17:27:08 GMT
Organization: AOL http://www.aol.com
>Is there a known problem with this Gestalt bit? Should I be
>testing some other way? Enlightenment appreciated. Here is my
>code:
>
> Boolean FinderIsScriptable()
> {
> long Response;
> OSErr Error;
>
> if((Error = Gestalt(gestaltFinderAttr, &Response)) != noErr)
> return(false);
>
> if(!BitTst(&Response, 31-gestaltOSLCompliantFinder))
> return(false);
>
> return true;
> }
I don't see any obvious problem. Here's a smaller, simplified version of
your function that works for me (and doesn't use BitTst).
Boolean FinderIsScriptable(void)
{
long response;
return ( (Gestalt(gestaltFinderAttr, &response) == noErr) &&
(response & (1 << gestaltOSLCompliantFinder)) );
}
- Jim Luther
---------------------------
>From gjenkins@facstaff.wisc.edu (Glenn Jenkins)
Subject: Drag gray rgn
Date: 15 Nov 1996 21:03:22 GMT
Organization: University of Wisconsin
Does anyone know of a stratagy to drag the outline of more than one
object? I can do a single object, but I eventually want to be able to drag
more than this and did not want re-invent the wheel
Thanks
Glenn
--
Glenn H. Jenkins
Dept of Human Oncology
University of Wisconsin
Madison, WI 53792
Ph (608) 263-4084
Fx (608) 263-4226
+++++++++++++++++++++++++++
>From srw@zanshin.com (Steve R Webster)
Date: Sat, 16 Nov 1996 12:38:42 -0800
Organization: Zanshin Software Inc.
In article <gjenkins-1511960303540001@144.92.218.197>,
gjenkins@facstaff.wisc.edu (Glenn Jenkins) wrote:
> Does anyone know of a stratagy to drag the outline of more than one
> object? I can do a single object, but I eventually want to be able to drag
> more than this and did not want re-invent the wheel
This is a bit obvious, but DragGrayRgn can take a region, and regions can
be discontinuous, so you could simply UnionRgn a bunch of smaller regions
together & pass the resulting mega-region to DragGrayRgn.
-steve
---------------------------
>From jvsolomito@aol.com
Subject: How Do I Disable Power Key?
Date: 20 Nov 1996 02:14:26 GMT
Organization: AOL http://www.aol.com
Hello,
I'm just starting out with programming and I've written one of those apps
that plays a random sound and shows a random pix when any key is pressed.
My daughter loves it, but has now figured out that pressing the power key
"does something really neat, Daddy."
Aside from holding my hand over it :-), how can I disable the power key?
Thanks in advance for any help.
John Solomito
JVSolomito@aol.com
+++++++++++++++++++++++++++
>From jeff@nts.com (Jeff Miller)
Date: Tue, 19 Nov 1996 18:51:15 -0800
Organization: Network TeleSystems, Inc.
In article <19961120021600.VAA06266@ladder01.news.aol.com>,
jvsolomito@aol.com wrote:
> Hello,
> I'm just starting out with programming and I've written one of those apps
> that plays a random sound and shows a random pix when any key is pressed.
> My daughter loves it, but has now figured out that pressing the power key
> "does something really neat, Daddy."
>
> Aside from holding my hand over it :-), how can I disable the power key?
You need the NoPowerOffKey extension. Check out:
http://hyperarchive.lcs.mit.edu/cgi-bin/NewSearch?key=NoPowerOffKey
Jeff
- ----------------------------------------------------------
Jeff Miller | jeff@nts.com | Network TeleSystems, Inc.
- ----------------------------------------------------------
---------------------------
>From amcclain@il-icom.net (Andrew W. McClain)
Subject: How do I convert a creator and file type???????
Date: Mon, 04 Nov 1996 21:53:58 -0500
Organization: Illinois Internet Communications, Inc.
How do I take the meaningless OSType numbers the file manager gives me and
convert them into nice 4 letter file type and creator types that I can put
into Str255's???????
Urgently,
Andrew W. McClain
--
Andrew McClain
+++++++++++++++++++++++++++
>From jlaauwen@knoware.nl (Jos Laauwen)
Date: Tue, 05 Nov 1996 21:45:32 +0100
Organization: CODE ZERO
In article <amcclain-0411962153580001@206.62.101.79>,
amcclain@il-icom.net (Andrew W. McClain) wrote:
>How do I take the meaningless OSType numbers the file manager gives me and
>convert them into nice 4 letter file type and creator types that I can put
>into Str255's???????
>
>Urgently,
>Andrew W. McClain
>
>--
>Andrew McClain
This is the routine I made for my personal library:
StringPtr ost2str ( OSType, StringPtr );
StringPtr ost2str ( OSType type, StringPtr osstr )
{
short i;
*osstr = 6;
osstr [1] = osstr [6] = '\'';
for (i=2; i<6; i++)
osstr [i] = type >> (5-i)*8 & 0xff;
return osstr;
}
It produces a four char string surrounded by ''. The surrounding is very
useful when the first or fourth char is a space.
I'm sure there are other variations on this theme but I hope this helps.
- -
jlaauwen@knoware.nl
+++++++++++++++++++++++++++
>From Brad Bennett <quicomm@interramp.com>
Date: 5 Nov 1996 06:19:08 GMT
Organization: Quicomm
amcclain@il-icom.net (Andrew W. McClain) wrote:
>How do I take the meaningless OSType numbers the file manager gives me and
>convert them into nice 4 letter file type and creator types that I can put
>into Str255's???????
>
>Urgently,
>Andrew W. McClain
Andrew:
Those meaningless "OSType numbers" of the file manager are really not
that meaningless...it just depends how you view them. You need to
view them as a set of 4 characters, not as a signed/unsigned long.
i.e.:
OSErr iErr;
FndrInfo tFndrInfo;
FSSpec tFSSpec;
SFTypeList tTL;
StandardFileReply reply;
char myFileType[5];
char myCreatorType[5];
StandardGetFile(nil,-1,tTL,&reply); // get a file with dialog
iErr = FSpGetFInfo(&reply.sfFile,&tFndrInfo); // get file info
memcpy((Ptr)myFileType,&tFndrInfo.fdType,4); // copy file type info
memcpy((Ptr)myCreatorType,&tFndrInfo.fdCreator,4); // copy file creator myFileType[4] = 0x00; // make sure it is a c string null terminated
myCreatorType[4] = 0x00; // make sure it is a c string null terminated
You will now have two c strings (myFileType and myCreatorType) to do
with what you please.
(please note that I haven't compiled the above code exactly as written..
so excuse any slight oversights. The basic idea remains valid, just use
the fdType and fdCreator OSTypes as 4 characters...not as a long.)
Best Regards,
Brad Bennett
Quicomm
http://www.quicomm.com
+++++++++++++++++++++++++++
>From richarde@sophisticated.com (Richard Elmore)
Date: Thu, 07 Nov 1996 19:37:34 -0800
Organization: Sophisticated Circuits, Inc.
In article <amcclain-0411962153580001@206.62.101.79>, amcclain@il-icom.net
(Andrew W. McClain) wrote:
> How do I take the meaningless OSType numbers the file manager gives me and
> convert them into nice 4 letter file type and creator types that I can put
> into Str255's???????
If you use the PowerPlant LString class instead of a generic Str255 there
is an assignment operator that lets do theString = theOSType.
- ---------------------------------------------------------------
Richard Elmore
Sophisticated Circuits, Inc.
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Mon, 11 Nov 1996 20:00:01 +0000
Organization: University of Bradford
Richard Elmore wrote:
>
> In article <amcclain-0411962153580001@206.62.101.79>, amcclain@il-icom.net
> (Andrew W. McClain) wrote:
>
> > How do I take the meaningless OSType numbers the file manager gives me and
> > convert them into nice 4 letter file type and creator types that I can put
> > into Str255's???????
>
> If you use the PowerPlant LString class instead of a generic Str255 there
> is an assignment operator that lets do theString = theOSType.
>
The broken way to do it is simply to cast the destination array to a
long* and stuff it into a char array;
char OSstring[5];
OSType theType;
OSstring[0]=4;
*((long*)OSstring+1)=theType;
Of course this will break on a 68000 if you hit an odd address. Best
(portable)
way is:
typedef unsigned char OSTypeStr[5];
OSTypeStr str;
OSType theType;
str[0]=(unsigned char)((theType&0xFF000000UL)>>24);
str[1]=(unsigned char)((theType&0x00FF0000UL)>>16);
str[2]=(unsigned char)((theType&0x0000FF00UL)>>8);
str[3]=(unsigned char)(theType&0x000000FFUL);
str[4]=0;
This makes a c-style ASCIIZ string which you can print using printf.
For Pascal-style strings:
str[0]=4;
str[1]=(unsigned char)((theType&0xFF000000UL)>>24);
str[2]=(unsigned char)((theType&0x00FF0000UL)>>16);
str[3]=(unsigned char)((theType&0x0000FF00UL)>>8);
str[4]=(unsigned char)(theType&0x000000FFUL);
If you know you are only compiling against 68020-plus machines
then the first, dirty method will work.
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From Lester Ward <lward@flashpt.com>
Date: Wed, 13 Nov 1996 16:18:49 -0500
Organization: Flashpoint, Inc.
> In article <amcclain-0411962153580001@206.62.101.79>, amcclain@il-icom.net
> (Andrew W. McClain) wrote:
>
> > How do I take the meaningless OSType numbers the file manager gives me and
> > convert them into nice 4 letter file type and creator types that I can put
> > into Str255's???????
The "meaningless" OSType numbers are really character arrays. So if your
type is 'Mine', it will be 0x4D696E65. 'M' in hex is 0x4D and so on.
In your debugger, view an OSType as characters and you'll see what I
mean.
You could do something ugly like this (assuming a valid vMyOSType):
Str255 vStr;
strncpy( (char *)&vStr[1],(char *)&vMyOSType,sizeof(OSType) );
vStr[0] = sizeof(OSType)]
Wordman
+++++++++++++++++++++++++++
>From mwherter@waterw.com (Dave McWherter)
Date: Sun, 17 Nov 1996 05:16:25 -0400
Organization: Water Wheel Systems, Marlton, NJ
In article <amcclain-0411962153580001@206.62.101.79>, amcclain@il-icom.net
(Andrew W. McClain) wrote:
> How do I take the meaningless OSType numbers the file manager gives me and
> convert them into nice 4 letter file type and creator types that I can put
> into Str255's???????
>
> Urgently,
> Andrew W. McClain
>
> --
> Andrew McClain
This will work:
OSType mytype;
char str[5];
long charmask = 0xFF;
str[4] = 0;
str[3] = (mytype && charmask);
mytype = mytype >> 8;
str[2] = (mytype && charmask);
mytype = mytype >> 8;
str[1] = (mytype && charmask);
mytype = mytype >> 8;
str[0] = (mytype && charmask);
(Constructing an OSType from a string is much the same...in reverse)
-David McWherter
+++++++++++++++++++++++++++
>From humbert@lorien.injep.fr (Xavier Humbert)
Date: Sun, 17 Nov 1996 13:27:48 +0100
Organization: XH Software
In article <amcclain-0411962153580001@206.62.101.79>,
amcclain@il-icom.net
(Andrew W. McClain) wrote:
> How do I take the meaningless OSType numbers the file manager gives me and
> convert them into nice 4 letter file type and creator types that I can put
> into Str255's???????
How about :
StringPtr OSTypeToPString(const OSType theType, Str255 theString)
{
theString[0] = 4;
*(OSType *)&theString[1] = theType;
return theString;
}
and :
char *OSTypeToCString(const OSType theType, char *theString)
{
theString[4] = 0;
*(OSType *)&theString[0] = theType;
return theString;
}
HTH,
Xav
- ---------------------------------------------------------------------
Xavier HUMBERT X H S O F T W A R E
humbert@lorien.injep.fr humbert@spieao.u-nancy.fr
+++++++++++++++++++++++++++
>From BHuey@worldnet.att.net (Hugh Johnson)
Date: Mon, 18 Nov 1996 19:44:07 -0500
Organization: AT&T WorldNet Services
In article <1996111713274838714@gondor.injep.fr>, humbert@lorien.injep.fr
(Xavier Humbert) wrote:
> In article <amcclain-0411962153580001@206.62.101.79>,
> amcclain@il-icom.net
> (Andrew W. McClain) wrote:
>
> > How do I take the meaningless OSType numbers the file manager gives me and
> > convert them into nice 4 letter file type and creator types that I can put
> > into Str255's???????
>
> How about :
>
> StringPtr OSTypeToPString(const OSType theType, Str255 theString)
> {
> theString[0] = 4;
> *(OSType *)&theString[1] = theType;
> return theString;
> }
>
> and :
>
> char *OSTypeToCString(const OSType theType, char *theString)
> {
> theString[4] = 0;
> *(OSType *)&theString[0] = theType;
> return theString;
> }
>
> HTH,
I can't resist throwing in my own varient:
union { OSType thLong; Str15 thStr; } u;
u.thLong = thTypeInQuestion;
BlockMoveData( u.thStr, u.thStr[1], 4 );
u.thStr[0] = 4;
--
The Universe is a Figment of its Own Imagination
---------------------------
>From khym@bga.com (Khym Mahn)
Subject: How to get the "kind" of a file
Date: 11 Nov 1996 23:01:34 -0600
Organization: Real/Time Communications - Bob Gustwick and Associates
Hi there, I was wondering if there was an easy way to the "kind" of a
file, the one the Finder shows when you view by something other than
icon or small icon.
It looks like I can do it by having a list of file types, such as
APPL, cdev, mdev, INIT, FFIL, etc... and for things that aren't on the
list, get the application associated with the file and append
"document". However, I don't have a comprehensive list of the
"standard" filetypes, that method doesn't known about "kind"
resources, it only works in English, and it seems like a really
annoying way to do it :)
So, is there a better way? :)
Thanks...
--
Name: Dave Huang | Mammal, mammal / their names are called /
INet: khym@bga.com | they raise a paw / the bat, the cat /
FurryMUCK: Dahan | dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 21 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
+++++++++++++++++++++++++++
>From khym@bga.com (Khym Mahn)
Date: 12 Nov 1996 20:58:57 -0600
Organization: Real/Time Communications - Bob Gustwick and Associates
In article <3288B7AA.7F11@vader.brad.ac.uk>,
David Gillies <daggilli@vader.brad.ac.uk> wrote:
>Khym Mahn wrote:
>> It looks like I can do it by having a list of file types, such as
>> APPL, cdev, mdev, INIT, FFIL, etc... and for things that aren't on the
>> list, get the application associated with the file and append
>> "document". However, I don't have a comprehensive list of the
>> "standard" filetypes, that method doesn't known about "kind"
>> resources, it only works in English, and it seems like a really
>> annoying way to do it :)
>Check out the PBDTGetAppl() routine...
That would get me the application associated with the file, but it
doesn't tell me anything about file types (only the creator is passed
in the parameter block). I'd like something that will tell me a
'ttxt/ttro' file is a "SimpleText read-only document", an 'APPL' is an
"application", an 'INIT' is a "system extension", etc...
--
Name: Dave Huang | Mammal, mammal / their names are called /
INet: khym@bga.com | they raise a paw / the bat, the cat /
FurryMUCK: Dahan | dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 21 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Tue, 12 Nov 1996 17:45:14 +0000
Organization: University of Bradford
Khym Mahn wrote:
>
> Hi there, I was wondering if there was an easy way to the "kind" of a
> file, the one the Finder shows when you view by something other than
> icon or small icon.
>
> It looks like I can do it by having a list of file types, such as
> APPL, cdev, mdev, INIT, FFIL, etc... and for things that aren't on the
> list, get the application associated with the file and append
> "document". However, I don't have a comprehensive list of the
> "standard" filetypes, that method doesn't known about "kind"
> resources, it only works in English, and it seems like a really
> annoying way to do it :)
>
> So, is there a better way? :)
>
> Thanks...
Check out the PBDTGetAppl() routine...
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From chrisn+@cmu.edu (Chris Newman)
Date: Tue, 12 Nov 1996 23:19:41 -0800
Organization: Altopia Corp. - Affordable Usenet Access - http://www.alt.net
In article <5690be$det@urchin.bga.com>, khym@bga.com (Khym Mahn) wrote:
>So, is there a better way? :)
GetDocumentKindString()
Only available if Macintosh Easy Open is installed. See
<http://devworld.apple.com/dev/technotes/tb/tb_41.html>
+++++++++++++++++++++++++++
>From khym@bga.com (Khym Mahn)
Date: 13 Nov 1996 22:14:37 -0600
Organization: Real/Time Communications - Bob Gustwick and Associates
In article <chrisn+-ya023080001211962319410001@news.alt.net>,
Chris Newman <chrisn+@cmu.edu> wrote:
>In article <5690be$det@urchin.bga.com>, khym@bga.com (Khym Mahn) wrote:
>>So, is there a better way? :)
>
>GetDocumentKindString()
Cool, thanks :) It's almost exactly what I'm looking for... however,
it doesn't return the right thing for INITs and control panels, among
other things. I get stuff like "Date & Time document", "Apple Menu
Options document", etc... So, does this mean I still need to keep a
table of special file types?
--
Name: Dave Huang | Mammal, mammal / their names are called /
INet: khym@bga.com | they raise a paw / the bat, the cat /
FurryMUCK: Dahan | dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 21 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
+++++++++++++++++++++++++++
>From chrisn+@cmu.edu (Chris Newman)
Date: Sat, 16 Nov 1996 01:02:12 -0800
Organization: Altopia Corp. - Affordable Usenet Access - http://www.alt.net
In article <56e6bd$1vq@urchin.bga.com>, khym@bga.com (Khym Mahn) wrote:
>In article <chrisn+-ya023080001211962319410001@news.alt.net>,
>Chris Newman <chrisn+@cmu.edu> wrote:
>>In article <5690be$det@urchin.bga.com>, khym@bga.com (Khym Mahn) wrote:
>>>So, is there a better way? :)
>>
>>GetDocumentKindString()
>
>Cool, thanks :) It's almost exactly what I'm looking for... however,
>it doesn't return the right thing for INITs and control panels, among
>other things. I get stuff like "Date & Time document", "Apple Menu
>Options document", etc... So, does this mean I still need to keep a
>table of special file types?
Yeah, I noticed that problem. I ended up special casing the following
types: cdev, appl, adrp, dfil, fact, INIT, thng, fext, PRER, adev, mdev,
appe, RDEV, FFIL, LWFN, zsys. Also the MACS creator. All system file
types. Anyone out there found a way to do this without special casing?
---------------------------
>From lalo7475@saintmarys.edu
Subject: Mac C help-Random
Date: Thu, 14 Nov 1996 15:31:05 -0600
Organization: Deja News Usenet Posting Service
I'm learning to program and I saw in this book calls like rand(15)
and rand(10). The one was to get a 60 percent outcome for a success
. Are these calls only picking numbers in the range given? If so
why in dice games do you use the ( rand() % 6) +1 to get a 1 in six
outcome. Woudln't you just use rand(6)?
Thanks
Frank La Lone
- ---------------------------------------------------------------------
This article was posted to Usenet via the Posting Service at Deja News:
http://www.dejanews.com/ [Search, Post, and Read Usenet News]
+++++++++++++++++++++++++++
>From BHuey@worldnet.att.net (Hugh Johnson)
Date: Thu, 14 Nov 1996 16:16:41 -0500
Organization: AT&T WorldNet Services
In article <848002071.29401@dejanews.com>, lalo7475@saintmarys.edu wrote:
> I'm learning to program and I saw in this book calls like rand(15)
> and rand(10). The one was to get a 60 percent outcome for a success
> . Are these calls only picking numbers in the range given? If so
> why in dice games do you use the ( rand() % 6) +1 to get a 1 in six
> outcome. Woudln't you just use rand(6)?
> Thanks
> Frank La Lone
I think rand() is an ANSI C function, not a Mac toolbox trap. The Mac call
is Random(), if I'm not mistaken.
Anyway, I think they both work somewhat alike. They do _not_ return values
within any specified range. I think the arguments you pass them merely
"seed" the algorithm that generates the psuedo-random number. In other
words, the algorithm itself will always return the same result if you keep
putting in the same seed value, so the idea is, you have to put in a new
value each time, like the current time (in ticks).
Anyway, to narrow down the return value of one of these functions, to
restrict it to a specific range, use the modulus operation. For instance,
if you want a number between zero and 15, write this:
long aLong;
GetDateTime( &aLong );
aLong = rand( aLong );
along %= 15;
--
True American P.O.W. (Prisoner of Worldnet)
+++++++++++++++++++++++++++
>From johnm@buttenet.com (Johnathon McAlister)
Date: Sun, 17 Nov 1996 16:39:54 -0700
Organization: Home
In article
<BHuey-1411961616420001@87.minnesota-001.mn.dial-access.att.net>,
BHuey@worldnet.att.net (Hugh Johnson) wrote:
>In article <848002071.29401@dejanews.com>, lalo7475@saintmarys.edu wrote:
>
>> I'm learning to program and I saw in this book calls like rand(15)
>> and rand(10). The one was to get a 60 percent outcome for a success
>> . Are these calls only picking numbers in the range given? If so
>> why in dice games do you use the ( rand() % 6) +1 to get a 1 in six
>> outcome. Woudln't you just use rand(6)?
>
>I think rand() is an ANSI C function, not a Mac toolbox trap. The Mac call
>is Random(), if I'm not mistaken.
True
>Anyway, I think they both work somewhat alike. They do _not_ return values
>within any specified range. I think the arguments you pass them merely
>"seed" the algorithm that generates the psuedo-random number. In other
>words, the algorithm itself will always return the same result if you keep
>putting in the same seed value, so the idea is, you have to put in a new
>value each time, like the current time (in ticks).
Be careful here! This could be read that you need to call Random() with a
param to get random values. This would be flagged by the compiler as an
error (if you're lucky) or would crash the computer! Random() takes no
parameters - giving it a param would screw up the stack.
I haven't looked too deeply, but the original IM Vol I, QuickDraw chapter,
states that the seed is in the global variable "randSeed".
--
Johnathon McAlister
Senior Programmer, MT Lottery (days)
Mac and Internet Consultant (evenings)
johnm@buttenet.com
---------------------------
>From Robin Lewis <ral@bnr.co.uk>
Subject: MacOS Printing Bug!
Date: Thu, 14 Nov 1996 10:23:33 +0000
Organization: Nortel Limited, Harlow, GB
Hi,
Can someone please confirm that using clip REGIONS does not work during
printing. In particular, if you use SetClip(clipRgn) before doing your
drawing, on your printout it behaves like ClipRect(clipRgnBounds). And
if you use CopyBits with a non-nil clipping region no clipping occurs at
all during printing.
There is a simple way to verify this if you have something like
'Flash-It' where you can capture an area of the screen with a lasso,
thereby creating a 'transparent' PICT with a non-square clipRgn. Open
that PICT in simpletext, then print it. On the printout your clipRgn has
been ignored.
I can't believe no-one has noticed this before.
Yours disgruntled, and unclipped,
Robin Lewis
<ral@nortel.co.uk>
+++++++++++++++++++++++++++
>From alain@cs.uchicago.edu (Alain Aslag Roy)
Date: Thu, 14 Nov 1996 16:00:01 GMT
Organization: The Anti-Weather Forecasters Coalition
In article <328AF321.6D37@bnr.co.uk>, Robin Lewis <ral@bnr.co.uk> wrote:
> Can someone please confirm that using clip REGIONS does not work
during
> printing.
>From Inside Macintosh, Volume 2 (Yup, the old series):
Page II-156 (Using the Print Manager)
For printing to the LaserWriter, you'll need to observe the following
limitations:
-Regions aren't supported, try to simulate them with polygons.
-Clipping regions should be limited to rectangles.
-"Invert" routines aren't supported.
-Copy is the only transfer mode supported for all objects except text and
bit images. For text, Bic is also supported. For bit images, the only
transfer mode not supported is Xor.
- -----------------------
So this might be a bit out of date, but it doesn't sound new or unexpected.
-alain
+++++++++++++++++++++++++++
>From "Stephen Coy" <stevec@magna.com.au>
Date: 16 Nov 96 21:50:59 +1100
Organization: Magna Data Internet Solutions
>Hi,
> Can someone please confirm that using clip REGIONS does not work during
>printing. In particular, if you use SetClip(clipRgn) before doing your
>drawing, on your printout it behaves like ClipRect(clipRgnBounds). And
>if you use CopyBits with a non-nil clipping region no clipping occurs at
>all during printing.
> There is a simple way to verify this if you have something like
>'Flash-It' where you can capture an area of the screen with a lasso,
>thereby creating a 'transparent' PICT with a non-square clipRgn. Open
>that PICT in simpletext, then print it. On the printout your clipRgn has
>been ignored.
> I can't believe no-one has noticed this before.
>
>Yours disgruntled, and unclipped,
> Robin Lewis
>
G'Day Robin,
This is a well known problem caused by the fact that postscript has no
notion of regions. You will probably find that your printing code works
fine on QuickDraw printers such as the ImageWriter and StyleWriters.
There is a host of tech notes on printing which you should consider
reading.
Regards,
Steve Coy
---------------------------
>From werdna@cyberjunkie.com (Andrew Wright)
Subject: OOP vs Structured style WAS: Re: Reasons for bloat?
Date: Thu, 14 Nov 1996 11:26:06 +1000
Organization: Prentice Centre, University of Queensland
<stuff about how C++/OOP is more inefficient and example of NiftyTelnet
(excellent program I might add) given as example snipped>
<rebuttal that OOP != framework (eg PowerPlant), and OOP is good snipped.>
I've got to add my two cents here. I've just written a small program for
the Mac (in straight C) to learn C, and how to write Mac programs. Now I am
turning many portions of that (nicely structured) program into classes. It
actually makes coding simpler in a number of cases. Sure, it takes a little
getting used to. But I think I agree with both previous posters - yes, C++
and OOP in general do make life easier. However, frameworks like PowerPlant
are not necessarily the best way to go for small, tight programs.
Unfortunately in these days of bloatware, the (relatively) small amount of
overhead that a framework provides is negligible.
--
Regards, | Visit me on-line
Andrew Wright | at
werdna@cyberjunkie.com | http://student.uq.edu.au/~s341797
+++++++++++++++++++++++++++
>From jkelly@sf.videonics.com (Joseph Kelly)
Date: Fri, 15 Nov 1996 15:19:52 -0800
Organization: Videonics, Inc
In article <werdna-ya023180001411961126060001@news.uq.edu.au>,
werdna@cyberjunkie.com (Andrew Wright) wrote:
> <stuff about how C++/OOP is more inefficient and example of NiftyTelnet
> (excellent program I might add) given as example snipped>
>
> <rebuttal that OOP != framework (eg PowerPlant), and OOP is good snipped.>
>
> I've got to add my two cents here.
Proponents of good OOP design say that 75% of time should be spent on
designing classes, 10% on implementing them (programming, sitting at a
computer), 5% on prototyping / conferring with users of the end product,
10% on testing. In fact, proponents of procedural software engineering
break it down similarly, with a large (> 65%) time spent on design.
They add further that elements of user interface are considered in only
10% of the (mostly final) design phase.
The projects that they are referring to are very large scale and complex
and require the work of more than one programmer (see "Object Oriented
Analysis and Design", by Booch).
Some say that converting a procedural C program directly to C++, w/o an
understanding of design pricinples may actually waste time, as there will
be a constant need to revise and re-write et al.
Using a framework is very helpful, according to "Design Patterns: Elements
of Reusable OO Software", Gamma/Helm/Johnson/Vlissides, as they describe a
particular application domain (pp26-28); in the case of PP, MA, or TCL
this refers to a document based application which emphasizes a certain
cooperation with the MacOS. The problem with frameworks is the steep
learning curve to become intimate with the framework and its
interconnections.
How pertinent do you think that all this emphasis on "good design" is in
production of non-buggy, on schedule, up to spec macintosh software? Do
you guys think it applies more to single programmer projects or multi
programmer projects?
--joe
--
Joseph V. Kelly, III | |\ /|
Macintosh Geek Dude | ||\/||
Videonics, Inc. | || ||acintosh, like, wow.
+++++++++++++++++++++++++++
>From tfischer@See.Address.In.Signature (Tim Fischer)
Date: Mon, 18 Nov 1996 09:56:36 -0600
Organization: Coda Music Technology
In article <jkelly-1511961519520001@jkelly.videonics.com>,
jkelly@sf.videonics.com (Joseph Kelly) wrote:
> How pertinent do you think that all this emphasis on "good design" is in
> production of non-buggy, on schedule, up to spec macintosh software? Do
> you guys think it applies more to single programmer projects or multi
> programmer projects?
I think the answer has more to do with how much you'll be back in the code
to enhance, debug, and otherwise modify. With all but toy projects, this
will be a lot of time. Over the years, experts have found that it costs
much more to modify a program (over time) than it does to design and
implement it. All the more true if the design was bad and you have to
'kludge' in your enhancements. Hence the focus on design in recent years
(first structured, modular programming, then OOP, etc). People are
finding out that more $$ invested in design means many less $$$ in the
future, and happier customers that can have more of the features they want
in the future without having to pay for a completely redesigned product.
Anyone who's ever went back inside code they've written a year or more ago
know that the code might as well have been written by another person.
Design idiosyncracies that made a lot of sense while you were writing it
will make no sense in a year. This is why it is a good programming
practice to design and document your code as if you were handing it over
to another programmer who will have no contact with you in the future.
Then when you go back into the code, you can relearn what you were
thinking (and hopefully not cuss yourself out!) THe paybacks for this are
even more obvious when your company hires on a new guy and takes over this
project from you...
While OOP goes a long way to make code more readable (encapuslation is a
'good thing'), I still believe that a liberal sprinkling of comments
throught the code goes is the most important aspect in understanding
existing code. I have worked with very well designed systems with almost
no comments, and it was much harder to get a handle on what's going on.
Comments are free, use 'em! My feeling is you should never have to look
at the code to find out a) what a procedure/method does, b) what
pararameters it expects (including defaults), c) what it returns, and d)
error handling/special cases/etc./etc.
Where the design pays off is when you need to add new features or change a
paradigm... ALWAYS design your code in a way that (within reason) any
assumption can be changed and it won't break your design or cause a kludgy
implementation. A fact of life is that no matter how the code is spec'ed,
the beta testers will want it to do more... That feature they said wasn't
important today, they'll want tomorrow!
I've been 'blessed' in a previous job to work in legacy code which was
written almost 20 years ago under a completely different paradigm. None
of the original authors of the code were with the company anymore, and
nobody knew exactly what the program did. Whenever I was asked to change
something, the only way to figure out what was going on was follow the
data through the code with an interactive debugger... Then you changed it
and prayed something else didn't break (it usually did...) This is not an
exaggeration, I can give you references for this (they're not with that
company anymore, either!) ;-)
My $0.02...
-Tim
--
- -------------------------------------
Tim Fischer
Coda Music Technology
The following email address is mangled to prevent automated
unsolicited junk mail. Replace the '_AT_' with an '@':
tfischer_AT_codamusic.com
---------------------------
>From yaofei@IDEA.UML.Edu (Fei Yao)
Subject: Question: NewGWorld call returns error -108
Date: 15 Nov 1996 03:50:38 GMT
Organization: A poorly-installed InterNetNews site
Hi:
I am using CW 7. In my program I have:
//********************
Rect offsrcRect;
<snip>
SetRect(&offsrcRect, 0, 0, 400, 450); /* left,top,right,bottom */
GetGWorld(&origPort,&origDev); /* save window's graphics port */
err = NewGWorld(&gworldPortPtr, 0, &offsrcRect, NULL,NULL,0);
if ( err == noErr)
<snip>
//********************
The above code works fine. But when I increased offsrcRect:
SetRect(&offsrcRect, 0, 0, 400, 460); /* left,top,right,bottom */
the NewGWorld call returned error of -108 (I got this value by using CW
debugger). I looked up Inside Macintosh, it says NewGWorld will return one of
three result codes:
noError 0 No error
paramErr -50 Illegal parameter
cDepthErr -157 Invalid pixel depth
So, what does error -108 mean?
BTW, is there a place I can find all the possible error codes listing?
Thanks in advance.
+++++++++++++++++++++++++++
>From mxmora@mxmdesigns.com (Matthew Xavier Mora)
Date: Thu, 14 Nov 1996 23:20:25 -0800
Organization: MXM DesignsÅ
> So, what does error -108 mean?
Lets see, type err-108 in Obiwan and it says:
Err-108 memFullErr iMemFullErr
Not enough room in heap zone
> BTW, is there a place I can find all the possible error codes listing?
Errors.h
Xavier
--
Matthew Xavier Mora <mailto:mxmora@mxmdesigns.com>
<http://www.best.com/~mxmora/mxm.html>
+++++++++++++++++++++++++++
>From davep@best.com (Dave Polaschek)
Date: Sun, 17 Nov 1996 07:42:44 -0600
Organization: Polaschek Publishing
In article <56gpae$87l@ulowell.uml.edu>, yaofei@IDEA.UML.Edu (Fei Yao) wrote:
> the NewGWorld call returned error of -108 (I got this value by using CW
> debugger). I looked up Inside Macintosh, it says NewGWorld will return
one of
> three result codes:
>
> noError 0 No error
> paramErr -50 Illegal parameter
> cDepthErr -157 Invalid pixel depth
>
> So, what does error -108 mean?
-108 is out of memory. Increase your application's partition, and it should
work.
> BTW, is there a place I can find all the possible error codes listing?
In Macsbug, you can type error #-108 (the # says it's decimal) to get told
what most errors are (it's not complete, but it's close).
The other place to look is in <Errors.h>.
-DaveP
--
Dave Polaschek - personal: davep@best.com or davep@mn.uswest.net
PGP key and other spiffy things at <http://www.best.com/~davep/>
+++++++++++++++++++++++++++
>From Mark Simpson <M.Simpson-CSSE96@cs.bham.ac.uk>
Date: Sun, 17 Nov 1996 11:55:12 +0000
Organization: School of Computer Science, University of Birmingham, UK
Fei Yao wrote:
>
> Hi:
>
> I am using CW 7. In my program I have:
>
> //********************
> Rect offsrcRect;
>
> <snip>
>
> SetRect(&offsrcRect, 0, 0, 400, 450); /* left,top,right,bottom */
> GetGWorld(&origPort,&origDev); /* save window's graphics port */
> err = NewGWorld(&gworldPortPtr, 0, &offsrcRect, NULL,NULL,0);
> if ( err == noErr)
>
> <snip>
> //********************
> The above code works fine. But when I increased offsrcRect:
>
> SetRect(&offsrcRect, 0, 0, 400, 460); /* left,top,right,bottom */
>
> the NewGWorld call returned error of -108 (I got this value by using CW
> debugger). I looked up Inside Macintosh, it says NewGWorld will return one of
> three result codes:
>
> noError 0 No error
> paramErr -50 Illegal parameter
> cDepthErr -157 Invalid pixel depth
>
> So, what does error -108 mean?
>
> BTW, is there a place I can find all the possible error codes listing?
>
> Thanks in advance.
-108 is an out of memory error. I've never used the gworld routines so I
can't help you beyond that.
As for the error code listing, an excellent little application that I
use is available from:
ftp://sunsite.doc.ic.ac.uk/packages/info-mac/_Information/mac-errors-20.hqx
Note that this is my local info-mac mirror - you should use the site
closest to you, but the pathname after info-mac/ will be the same
Mark
---------------------------
>From uzs90z@uni-bonn.de (Michael Schuerig)
Subject: Reasons for bloat?
Date: Wed, 6 Nov 1996 15:48:32 +0100
Organization: RHRZ - University of Bonn (Germany)
There are several applications that are rather infamous for their
resource appetite. In some cases such Word 6.0 the reasons seem quite
obvious, as it contains a port of a half Windows. But what about
Netscape Navigator 3.0? As it seems it's written using PowerPlant and
therefore I guess at least somewhat Mac-like -- nevertheless it eats up
about 9MB of RAM. Why?
Or, looking elsewhere, at the stuff that appears daily on info-mac. I'm
really astonished by the RAM and disk footprint of some newly written
applications that only have remarkably few features. Is this the result
of carelessness? Anyway, we all know that memory (disk/RAM) is cheap? Or
just a rational decision, as it would have required so much more effort
to use less resources? What's the place of frameworks (MacApp, TCL,
PowerPlant) in this game?
Wondering,
Michael
- -
Michael Schuerig
mailto:uzs90z@uni-bonn.de
http://www.rhrz.uni-bonn.de/~uzs90z/
+++++++++++++++++++++++++++
>From fpottier@pauillac.inria.fr (Francois Pottier)
Date: 6 Nov 1996 16:37:06 GMT
Organization: INRIA Rocquencourt, BP 105, 78153 Le Chesnay Cedex, France
In article <wmU=TWq00iWp05qXM0@andrew.cmu.edu>,
Joshua C Horan <horan+@andrew.cmu.edu> wrote:
> Besides who can run 3.0 for more than 3 minutes without discovering
> it's special "crash or freeze the computer" feature?
I can. It works fine on my machine.
>that pointers go at the *bottom* of the heap and that there is this neat
>HLockHi() function, or while we're at it how about: DisposePtr(),
>HUnlock(), HPurge().
These functions are leftover from the 1984 Mac and should have long been
obsolete, if Apple had been able to ship Copland in time. In a modern
OS, all developers should see is pointers. It should be the OS's job to
use the MMU to avoid fragmentation.
I'm not saying Netscape is well programmed - I'm only saying that looking
at a program heap tells you nothing about the way it's programmed.
As for the original question: programmers stop optimizing the program when
it runs acceptably on their machines. Programmers have fast machines. Hence,
programs are always resource-hungry.
--
Francois Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/
+++++++++++++++++++++++++++
>From passenger@cybercom.net (T. Vector)
Date: Thu, 07 Nov 1996 17:32:20 -0400
Organization: Cyber Access Internet Services (617) 396-0491
>I was just using Netscape 2.02 the other day and it kept complaining
>about not having enough memory even with a 9 MB partition! Good thing I
>wasn't using 3.0 otherwise it would need 11 MB! Besides who can run 3.0
>for more than 3 minutes without discovering it's special "crash or
>freeze the computer" feature?
>Anyway, I used ZoneRanger to take a look at the Netscape heap and it was
>a complete mess! There were pointers all over the place and handles
>locked in the middle of the heap. This was the worst memory management
>I've seen in a while. Maybe we should inform the Netscape developers
>that pointers go at the *bottom* of the heap and that there is this neat
>HLockHi() function, or while we're at it how about: DisposePtr(),
>HUnlock(), HPurge().
>
>Anyone else feel up to some Netscape Bashing?
>
a dirty heap is the least of its problems. there's stuff in there that
*nobody* can figure out. somebody thought they knew how to create
an A5 world, and thumbed through an old book (Knaster's?) to implement
it. for real fun, open a plugin, and step through. i'd rather debug the
Print Mgr.
+++++++++++++++++++++++++++
>From kempkec@multiad.com (Christopher Kempke)
Date: Wed, 13 Nov 1996 10:42:41 -0600
Organization: Multi-Ad Services, Inc.
chrisn+@cmu.edu (Chris Newman) wrote
[Snip (and there's more where that came from)]
> I would say the two biggest culprits are C++ and Object Oriented
> Programming (the acronym OOPS fits quite well). You see OOPS is all the
> rage these days. Everyone thinks it's so cool. What does it add to the
> programming experience? It makes programs bigger, slower, more complicated
> and harder to debug.
Slow, I'll acknowledge, in certain instances. But if OOP is making your
programs bigger, more complicated, or harder to debug, you aren't doing it
right. Code re-use and modular design are two of the big benefits of OOP.
And C++ is usually only trivially more inefficient than "pure" C, an
inefficiency that can usually be compensated for by the increased
descriptive power of the language.
Good object-oriented design is a learned skill. Many C++/Java programmers
haven't learned it. But that doesn't negate the fact that it's been years
since I heard someone seriously suggest that for the majority of programs
structural programming leads to better design or code than object-oriented
programming. That battle's been fought and won. The new one is to try
and find the next incremental step toward better program design.
There is a lot of fear among non-C++ programmers about C++'s legendary
complexity. That complexity is largely a myth; the parts of C++ you need
to learn in order to implement good OO programs is relatively small. Most
of the rest are syntactic games to make common tasks easier. But nearly
every feature of C++ was added to make some programming task simpler, not
more complex.
> Take a look at PowerPlant. There are so many object classes in that
> framework that it requires a "class browser" just to make heads or tails of
> it. A simple operation can generate a chain of hundreds of do-nothing
> function calls. Do you think the average programmer has any idea of how it
> all fits together? I seriously doubt it. So they end up blindly creating
> more objects which add more layers of complexity in the hopes that somehow
> things will start working.
And the hound dog howls at midnight. This paragraph has nothing to do
with the previous one. OOP != Frameworks. Frameworks are a common type
programming tool, and they're often implemented in OO languages, but
there's nothing requiring that. There are plenty of non-OOP frameworks,
and plenty of OOP ones written in languages other than C++.
But to answer your points anyway: Lots of people programming in
Powerplant before the class browser even existed. If you're using a
class browser as a substitute for learning the framework, you're already
at a disadvantage.
I dare you to point me to ANY "simple operation" in Powerplant or any
other well-designed framework that "generates a chain of hundreds of
do-nothing function calls." Sure, you can build such a thing (in any
language). But it
wouldn't make any sense to.
Yes, I believe the average Powerplant programmer has a very good idea how
it all fits together. If it didn't simplify the programming process, why
would people use it? You claim that there are all sorts of program which
have been bloated by frameworks -- they were all constructed by randomly
slapping objects into a framework nobody could understand? I think you
jest. The fact that frame-work generated programs are popular would seem
to put the lie to that statement.
And now if I can pull out the strong words: "So they end up blindly
creating more objects which add more layers of complexity in the hopes
that somehow things will start working."
Let me be blunt. Anyone who programs this way is either a beginner or an
idiot. Anyone who pays people to program this way is either ignorant of
the programming process or an idiot.
I believe (and I mean no disrespect) that you don't understand
Object-Oriented programming, and that you are making the common human
assumption that things you don't understand must be stupid, needlessly
complicated, or useless. However, just because this belief pattern is
common doesn't make it true.
--Chris
--
Christopher Kempke, kempkec@multiad.com
Sr. Software Architect, Multi-Ad Services Inc.
(I do not speak for my company, profession, or species)
+++++++++++++++++++++++++++
>From chrisn+@cmu.edu (Chris Newman)
Date: Tue, 12 Nov 1996 23:00:31 -0800
Organization: Altopia Corp. - Affordable Usenet Access - http://www.alt.net
In article <1996110615483251928@rhrz-ts3-p8.rhrz.uni-bonn.de>,
uzs90z@uni-bonn.de (Michael Schuerig) wrote:
>Or, looking elsewhere, at the stuff that appears daily on info-mac. I'm
>really astonished by the RAM and disk footprint of some newly written
>applications that only have remarkably few features. Is this the result
>of carelessness? Anyway, we all know that memory (disk/RAM) is cheap? Or
>just a rational decision, as it would have required so much more effort
>to use less resources? What's the place of frameworks (MacApp, TCL,
>PowerPlant) in this game?
I would say the two biggest culprits are C++ and Object Oriented
Programming (the acronym OOPS fits quite well). You see OOPS is all the
rage these days. Everyone thinks it's so cool. What does it add to the
programming experience? It makes programs bigger, slower, more complicated
and harder to debug.
Take a look at PowerPlant. There are so many object classes in that
framework that it requires a "class browser" just to make heads or tails of
it. A simple operation can generate a chain of hundreds of do-nothing
function calls. Do you think the average programmer has any idea of how it
all fits together? I seriously doubt it. So they end up blindly creating
more objects which add more layers of complexity in the hopes that somehow
things will start working.
If Mac programmers really want to make the Macintosh wonderful we should
throw out our C++ and OOPS garbage and start writing clean simple
well-modularized programs from scratch. A framework shouldn't add 100K or
1MB of overhead and slow down the program. It should cost 20K or 10K and
make it easy to write fast programs.
Just to show that I practice what I preach, feel free to check out
NiftyTelnet <http://andrew2.andrew.cmu.edu/dist/niftytelnet.html>. Oh, I'm
not closed minded so I'll admit that on rare occasions, objects are useful.
NiftyTelnet has 2 object types, implemented in vanilla C.
Sorry if I sound like I'm preaching, but it's an uphill battle fighting
against the OOPS propaganda machine.
- Chris Newman
+++++++++++++++++++++++++++
>From BHuey@worldnet.att.net (Hugh Johnson)
Date: Wed, 13 Nov 1996 23:08:33 -0500
Organization: AT&T WorldNet Services
In article <kempkec-1311961042410001@news.orbis.net>, kempkec@multiad.com
(Christopher Kempke) wrote:
>
> Slow, I'll acknowledge, in certain instances. But if OOP is making your
> programs bigger, more complicated, or harder to debug, you aren't doing it
> right. Code re-use and modular design are two of the big benefits of OOP.
> And C++ is usually only trivially more inefficient than "pure" C, an
> inefficiency that can usually be compensated for by the increased
> descriptive power of the language.
>
> Good object-oriented design is a learned skill. Many C++/Java programmers
> haven't learned it. But that doesn't negate the fact that it's been years
> since I heard someone seriously suggest that for the majority of programs
> structural programming leads to better design or code than object-oriented
> programming. That battle's been fought and won. The new one is to try
> and find the next incremental step toward better program design.
>
> There is a lot of fear among non-C++ programmers about C++'s legendary
> complexity. That complexity is largely a myth; the parts of C++ you need
> to learn in order to implement good OO programs is relatively small. Most
> of the rest are syntactic games to make common tasks easier. But nearly
> every feature of C++ was added to make some programming task simpler, not
> more complex.
>
Read Richard Gabriel's "Patterns of Software". It'll change your mind
about OOP. I use a lot of objects myself, but I definitely do _not_ define
everything as a class (nor do I even try to). I try to do everything in
".cp" (C++) files, just because the C++ compiler is better at
type-checking and a few other things, but mostly I'd say my code is more
than half plain vanilla C. I've stopped using references, even though I
learned to code with references. Pointers are _much_ easier to understand
at a glance.
What it all boils down to, as Gabriel said in his book, is that we as
programmers have to "live in" our code; we have to continually upgrade it
and squash bugs and so forth, so it's never a finished product. It has to
be "habitable", like a cozy farmhouse that you add new rooms onto when
your family grows. The big architecture model, in opposition to that, just
plain sucks. Reusability between projects is largely a myth. Reusablity is
only correctly applied within a given project, where your custom-made
objects allow customized expansion.
Just my 2¢.
--
The universe is a figment of it's own imagination.
+++++++++++++++++++++++++++
>From nakaaran@micronet.fr (Alain Bertrand)
Date: Sun, 17 Nov 1996 10:21:01 +0100
Organization: Francenet -- Paris, France
Ed Anson <tulip@tiac.net> wrote:
> >But I'd go further and say that while good modular design is
> > fairly easy to learn, good object-oriented design is much harder. OOPS is
> > a plot to make programming harder for the average joe.
>
> The average joe doesn't program commercial applications. OOPS is a
> technology to make difficult programs easier for a skilled programmer, and
> to make otherwise intractable programming tasks manageable. If that
> requires a bit more learning -- then so be it. The average joe can still
> program toy programs in toy languages, and OOPS won't get in his way.
I'm an average joe programmer and I do feel that getting the code with
the data (e.g. OOP) makes my joe programming far easier that modular
design. I like multiple inheritance too because I can slice my problems
into small parts that I can test separately and be sure that they will
behave correctly when put into the same program. Why do you need to
pretend that OOP is more difficult? Did you learn it when you where
already close to retirement :=)?
--
Alain Bertrand
nakaaran@micronet.fr
+++++++++++++++++++++++++++
>From lars.farm@ite.mh.se (Lars Farm)
Date: Sat, 16 Nov 1996 14:24:35 +0100
Organization: pv
Chris Newman <chrisn+@cmu.edu> wrote:
> If you have to call a procedure through a function pointer rather than
> directly, it's significantly slower.
Compare to what you'd do in C in similar situations:
C:
enum kind { rect, circle, triangle };
struct Shape { kind tag; ... };
void draw_shapes( Shape*shapes, int N ) {
for ( int i = 0 ; i < N ; i++ )
switch ( shapes[i].tag ) {
case rect: draw_rect( shapes+i ); break;
case circle: draw_circle( shapes+i ); break;
case triangle: draw_triangle( shapes+i ); break;
default:
... oops some moron invented a new shape ...
abort();
break;
}
}
As you can see there is a price to pay even without function pointers.
(1) Not (easily) extendable. (2) Inspect each shape and select the
proper routine at runtime.
C++:
struct Shape { virtual void draw() = 0; };
void draw_shapes( const ShapeArray& shapes ) {
for ( ShapeIter p = shapes.begin(); p != shapes.end(); ++p )
p->draw(); // any kind of shape.
} // including the ones not yet invented
If you don't need polymorphic behaviour, don't use virtual. If you need
it, you'd have to pay the price in C or Pascal too.
> And then there's multiple inheritance
> -- a great bain of efficient programming.
Why?
> Plus there's the data losing
> problem (data hiding taken too far) which leads to function calls which set
> one variable.
inline
As for OOP and frameworks. They are different beasts.
A framework tries to be everything for everyone and tends to become a
compromise for everyone and optimal for no one. They do too much. They
grow throughout their lifetime, they never shrink and they eventually
become bloated, interconnected and tangled.
> I'm not at all afraid of C++, except for the bloat and inefficiency it
> would add to my code.
C++ or OOP doesn't cause bloat. Bad design does. Frameworks are designed
partly by its designers, partly by these newsgroups and partly by
important customers, by making multiple and diverse feature requests
that are accepted.
The only feature requests that are consistently rejected are the ones
that ask for a smaller framework because a shrinking feature list
doesn't look good to marketing or the designers in charge. Many users of
frameworks have no need for many features in a particular framework, but
it is there anyway.
This is market forces at work combined with design decisions and project
management. It has very little to do with OOP or C++.
> Of course PowerPlant simplifies the programming process -- it would take a
> bright person at least a couple months to discover and understand all the
> OS incantations necessary to start an app and set up an event loop
> according to the HIG. But PowerPlant/TCL certainly doesn't simplify the
> resulting program.
This is the compromise of frameworks, not the price of OOP. For many the
advantages of a framework far outweighs the disadvantages.
--
Lars Farm, lars.farm@ite.mh.se
+++++++++++++++++++++++++++
>From tulip@tiac.net (Ed Anson)
Date: Sat, 16 Nov 1996 14:21:53 -0500
Organization: Tulip Software
OOP doesn't cause bloat. It can help avoid it.
In article <chrisn+-ya023080001611960052210001@news.alt.net>,
chrisn+@cmu.edu (Chris Newman) wrote:
> If you have to call a procedure through a function pointer rather than
> directly, it's significantly slower. And then there's multiple inheritance
> -- a great bain of efficient programming. Plus there's the data losing
> problem (data hiding taken too far) which leads to function calls which set
> one variable.
A good compiler implements a call via a pointer only for a virtual method,
so the performance penalty only applies when you need the capability. The
posix code you mention below also uses pointers to dispatch calls. It just
does it the hard way instead of using the built-in dispatching of C++. (I
recently found myself putting a class wrapper around part of it in order
to get the flexibility I needed without adding enormous amounts of code.)
And if you need a function that just sets one variable (not a common thing
in good OO design) then an in-line procedure does the trick with no
overhead and a cleaner design IMNSHO.
> Modular design doesn't require OOP. In fact modular design is often better
> *without* OOP. If I have a sophisticated structure and there are several
> different sets of operations I apply to it -- I can put those operations in
> sepearte modules. With OOP and "the functions must go with the object"
> dogma, you're stuck with one big module. As for code re-use, I'd say that
> the standard C and posix libraries have been more successful than *any* OOP
> object.
Indeed, you can do OO programming with C. It's just harder. In fact, I did
object oriented design for a decade or so before C++ became available to
me. When it became available, it was a great help because it relieved me
of many details and made things feasible that I wouldn't attempt with C.
> The libraries tend to be much bigger. And the overhead to manage some of
> the more complicated inheritance features is very significant. The only
> significant things C++ can do which C can't trivially is multiple
> inheritance, inline functions and exceptions. I'll admit the latter two
> are useful.
Application frameworks tend to be fairly large. That is only because they
cover a lot more ground than the C skeletons they replace. They can do
that because of the added flexibility OO provides. A good framework (e.g.,
PowerPlant) doesn't require you to include the parts that aren't needed by
your application. The framework accounts for only a tiny fraction of the
code in a typical commercial application.
>But I'd go further and say that while good modular design is
> fairly easy to learn, good object-oriented design is much harder. OOPS is
> a plot to make programming harder for the average joe.
The average joe doesn't program commercial applications. OOPS is a
technology to make difficult programs easier for a skilled programmer, and
to make otherwise intractable programming tasks manageable. If that
requires a bit more learning -- then so be it. The average joe can still
program toy programs in toy languages, and OOPS won't get in his way.
> It's been years since I heard someone seriously suggest that the Macintosh
> market would replace Windows. That battle's been fought and won. But it
> doesn't mean the right side won. I like going with the underdog when it's
> better. :-)
You seem to have your chronology mixed up. It is Windows that is trying to
replace the Macintosh. From a marketing standpoint, it seems to be doing
fairly well. Otherwise, I agree with you. So what?
> I'm not at all afraid of C++, except for the bloat and inefficiency it
> would add to my code. Exceptions and inline functions are nice, multiple
> inheritance sucks, and a lot of the syntactic sugar ends up simply
> obfuscating the code.
You contradict yourself here. Exceptions are a powerful tool for making
code more compact. Although inline functions sometimes make code larger,
they also tend to make it more efficient. They can (in many cases)
actually make the code smaller. Multiple inheritance is best used
sparingly, but when appropriate it can also simplify the code and (YES)
make it more compact. I have experienced these results through years of
C++ programming. As for syntactic sugar: it's sugar only if it's sweet. I
tend to ignore large parts of C++ because they are arcane and have nothing
to do with OOP.
> When I studied PowerPlant/TCL I recall all sorts of "message dispatchers"
> which sent messages down a complex chain of objects. The mostly-non-OOP
> framework I wrote for myself sends the event directly to the window
> procedure that handles it.
The message dispatchers are actually a simplifying pattern. If your own
event dispatcher knows (without any looking around) exactly which
procedure needs to handle each event, then your program is either
extremely simple or your event dispatcher has been customized beyond
belief. Message dispatching tends to greatly reduce the size and
complexity of an otherwise large and complex program. It is basically an
organized way of locating the correct handler (out of the many available)
for a particular event. In a really simple program, you can generally
override the event handling methods and handle events directly.
> I've seen this happen far too often. It'd be better to train people with
> simple modular design and OOP as an "advanced topic". I'm a strong
> believer in the K.I.S.S. principle.
For really simple programs (as typically encountered by beginners and
students), there is really very little difference between OOP and a simple
modular design. Perhaps beginners needn't learn all the intricacies of OOP
right away, but professional programmers need to use OOP to do real work.
Today's software applications are far too complex to manage efficiently
without it.
OOP and frameworks don't cause bloat. My experience has been somewhat the
opposite. For example, I recently took an application written in C. I
totally rewrote it using PowerPlant and C++. I roughly doubled its feature
set. When I got done I had a more useful program with fewer bugs and a
more responsive user interface. And how much did I increase the memory
requirements? None at all. The new program has the same system
requirements as the old one.
So what is the real cause of program bloat?
Actually, there are many causes, and they do not result from OOP. Too many
programmers pay too little attention to memory management. They add
features as appendages instead of integrating them into a coherent
architecture as OOP would enable them to do. In short, program bloat
happens because customers accept it and programmers typically have neither
the skill nor the incentive to avoid it. After all, memory is getting
cheaper :-)
- --------------------
Ed Anson
Tulip Software
Andover, MA 01810
U.S.A. <http://www.tiac.net/users/tulip/home.html>
+++++++++++++++++++++++++++
>From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
Date: Mon, 18 Nov 1996 19:18:20 +1200
Organization: (none)
chrisn+@cmu.edu (Chris Newman) writes:
> >[OOP is] Slow, I'll acknowledge, in certain instances.
>
> If you have to call a procedure through a function pointer rather than
> directly, it's significantly slower.
If you know exactly which function you want to call then you can call it
directly, even if it's virtual. If you don't know exactly which function
you will want to call then you'll have to handle exactly the same problem
in a non-OOP language, via either a manually set up function pointer or
a switch statement. The better-written non-OOP programs use function
pointers. C++ simply automates the bookkeeping for you.
> And then there's multiple inheritance -- a great bain of efficient
> programming.
If you don't need it then don't use it -- and hen it doesn't cost you
anything. If you do need that sort of capability in a non-OOP language
then you're going to have to do a *lot* of manual work to duplicate it.
> Plus there's the data losing problem (data hiding taken too far) which
> leads to function calls which set one variable.
No one's forcing you to do that. And even if you want to write it in
functional form instead of as an assignment, inlining (which you admit
to liking) will get back the efficiency for you.
> >But if OOP is making your
> >programs bigger, more complicated, or harder to debug, you aren't doing it
> >right. Code re-use and modular design are two of the big benefits of OOP.
>
> Modular design doesn't require OOP. In fact modular design is often better
> *without* OOP.
So don't use OOP in those cases. There are other cases where OOP *is* the best
way to do things.
> If I have a sophisticated structure and there are several
> different sets of operations I apply to it -- I can put those operations in
> sepearte modules. With OOP and "the functions must go with the object"
> dogma, you're stuck with one big module.
That's not a limitation of OOP, but only of C++. Other OOP languages such
as Lisp/CLOS and Dylan don't suffer from it.
> As for code re-use, I'd say that the standard C and posix libraries have
> been more successful than *any* OOP object.
C and Unix have been around for 20+ years. When I first used it, in 1981,
the C standard library, wasn't. Just watch STL in ten years time.
> >And C++ is usually only trivially more inefficient than "pure" C, an
> >inefficiency that can usually be compensated for by the increased
> >descriptive power of the language.
>
> The libraries tend to be much bigger.
Not if they have the same functionality.
> And the overhead to manage some of the more complicated inheritance
> features is very significant.
So if you don't need thos capabilities then don't use those facilities
and they will cost you nothing. If you *do* want thase capabilities, and
are using a non-OOP language then you will have a *lot* of tedious manual
work ahead of you. And probably do it less well than your C++ compiler
vendor.
> The only significant things C++ can do which C can't trivially is multiple
> inheritance, inline functions and exceptions. I'll admit the latter two
> are useful.
And templates. Sure you can hack a similar thing using macros, but then
that's even *more* true of inline functions, which you accept as useful.
> >Good object-oriented design is a learned skill. Many C++/Java programmers
> >haven't learned it.
>
> Agreed. But I'd go further and say that while good modular design is
> fairly easy to learn, good object-oriented design is much harder. OOPS is
> a plot to make programming harder for the average joe.
You've got some sort of a point there. That's why there's Visual Basic for
the average Joe. OOP was designed by good programmers, to make their own
work easier. If it doesn't make life easier for poor or average programmers
-- well, that's too bad, I guess.
-- Bruce
--
...in 1996, software marketers wore out a record 31,296 copies of Roget's
Thesaurus searching for synonyms to the word "coffee" ...
+++++++++++++++++++++++++++
>From chrisn+@cmu.edu (Chris Newman)
Date: Sat, 16 Nov 1996 00:52:21 -0800
Organization: Altopia Corp. - Affordable Usenet Access - http://www.alt.net
In article <kempkec-1311961042410001@news.orbis.net>, kempkec@multiad.com
(Christopher Kempke) wrote:
>chrisn+@cmu.edu (Chris Newman) wrote
>
>[Snip (and there's more where that came from)]
Hah! You fell for my bait -- I'm always up for a good intellectual battle. :-)
>[OOP is] Slow, I'll acknowledge, in certain instances.
If you have to call a procedure through a function pointer rather than
directly, it's significantly slower. And then there's multiple inheritance
-- a great bain of efficient programming. Plus there's the data losing
problem (data hiding taken too far) which leads to function calls which set
one variable.
>But if OOP is making your
>programs bigger, more complicated, or harder to debug, you aren't doing it
>right. Code re-use and modular design are two of the big benefits of OOP.
Modular design doesn't require OOP. In fact modular design is often better
*without* OOP. If I have a sophisticated structure and there are several
different sets of operations I apply to it -- I can put those operations in
sepearte modules. With OOP and "the functions must go with the object"
dogma, you're stuck with one big module. As for code re-use, I'd say that
the standard C and posix libraries have been more successful than *any* OOP
object.
>And C++ is usually only trivially more inefficient than "pure" C, an
>inefficiency that can usually be compensated for by the increased
>descriptive power of the language.
The libraries tend to be much bigger. And the overhead to manage some of
the more complicated inheritance features is very significant. The only
significant things C++ can do which C can't trivially is multiple
inheritance, inline functions and exceptions. I'll admit the latter two
are useful.
>Good object-oriented design is a learned skill. Many C++/Java programmers
>haven't learned it.
Agreed. But I'd go further and say that while good modular design is
fairly easy to learn, good object-oriented design is much harder. OOPS is
a plot to make programming harder for the average joe.
> But that doesn't negate the fact that it's been years
>since I heard someone seriously suggest that for the majority of programs
>structural programming leads to better design or code than object-oriented
>programming. That battle's been fought and won.
It's been years since I heard someone seriously suggest that the Macintosh
market would replace Windows. That battle's been fought and won. But it
doesn't mean the right side won. I like going with the underdog when it's
better. :-)
>There is a lot of fear among non-C++ programmers about C++'s legendary
>complexity. That complexity is largely a myth; the parts of C++ you need
>to learn in order to implement good OO programs is relatively small. Most
>of the rest are syntactic games to make common tasks easier. But nearly
>every feature of C++ was added to make some programming task simpler, not
>more complex.
I'm not at all afraid of C++, except for the bloat and inefficiency it
would add to my code. Exceptions and inline functions are nice, multiple
inheritance sucks, and a lot of the syntactic sugar ends up simply
obfuscating the code.
>I dare you to point me to ANY "simple operation" in Powerplant or any
>other well-designed framework that "generates a chain of hundreds of
>do-nothing function calls." Sure, you can build such a thing (in any
>language). But it wouldn't make any sense to.
When I studied PowerPlant/TCL I recall all sorts of "message dispatchers"
which sent messages down a complex chain of objects. The mostly-non-OOP
framework I wrote for myself sends the event directly to the window
procedure that handles it.
>Yes, I believe the average Powerplant programmer has a very good idea how
>it all fits together. If it didn't simplify the programming process, why
>would people use it?
Of course PowerPlant simplifies the programming process -- it would take a
bright person at least a couple months to discover and understand all the
OS incantations necessary to start an app and set up an event loop
according to the HIG. But PowerPlant/TCL certainly doesn't simplify the
resulting program.
>The fact that frame-work generated programs are popular would seem
>to put the lie to that statement.
Windows is more popular than the Mac. Querty is more popular than Dvorak.
The popular is not always the better -- often it's just the better
propaganda.
>And now if I can pull out the strong words: "So they end up blindly
>creating more objects which add more layers of complexity in the hopes
>that somehow things will start working."
>
>Let me be blunt. Anyone who programs this way is either a beginner or an
>idiot. Anyone who pays people to program this way is either ignorant of
>the programming process or an idiot.
I've seen this happen far too often. It'd be better to train people with
simple modular design and OOP as an "advanced topic". I'm a strong
believer in the K.I.S.S. principle.
>I believe (and I mean no disrespect) that you don't understand
>Object-Oriented programming, and that you are making the common human
>assumption that things you don't understand must be stupid, needlessly
>complicated, or useless.
A reasonable assumption, but incorrect. I believe I have a very good
understanding of OOP and how/when to use those techniques. It is a very
powerful tool which should only be used when necessary. There's no need to
use a $200 spreadsheet when a $10 calculator will do the job.
Cheers,
- Chris
+++++++++++++++++++++++++++
>From chrisn+@cmu.edu (Chris Newman)
Date: Mon, 18 Nov 1996 23:33:10 -0800
Organization: Altopia Corp. - Affordable Usenet Access - http://www.alt.net
In article <tulip-1611961421530001@tulip.tiac.net>, tulip@tiac.net (Ed
Anson) wrote:
>A good compiler implements a call via a pointer only for a virtual method,
>so the performance penalty only applies when you need the capability.
That's fine, except most programmers use virtual methods most of the time,
thinking it may be useful to plug in something else at a later date, even
if they never do so.
>Application frameworks tend to be fairly large. That is only because they
>cover a lot more ground than the C skeletons they replace. They can do
>that because of the added flexibility OO provides.
Flexibility comes at the expense of efficiency. Every layer of indirection
makes a program less efficient and OOP design encourages more layering.
>The framework accounts for only a tiny fraction of the
>code in a typical commercial application.
True, but not an excuse to waste between 100K and 1MB on a framework. When
programmers forget to worry about the 100K of unnecessary overhead that a
particular piece adds, the waste accumulates and adds up to bloat.
>The average joe doesn't program commercial applications. OOPS is a
>technology to make difficult programs easier for a skilled programmer, and
>to make otherwise intractable programming tasks manageable. If that
>requires a bit more learning -- then so be it. The average joe can still
>program toy programs in toy languages, and OOPS won't get in his way.
I'm quite happy writing my telnet client in a "toy language" like C. Funny
how I can do things that most other programmers find too difficult, like
fully asynchronous network I/O without threads. C++ allows people to
pretend they're doing good modular design when they're really turning their
project into an intractible mess of objects and inheritance. Of course,
the old maxim goes "any problem can be fixed by another level of
indirection."
>For really simple programs (as typically encountered by beginners and
>students), there is really very little difference between OOP and a simple
>modular design. Perhaps beginners needn't learn all the intricacies of OOP
>right away, but professional programmers need to use OOP to do real work.
>Today's software applications are far too complex to manage efficiently
>without it.
I'm completely unimpressed with your haughtiness. I know of some extremely
sophisticated and complex commercial systems that are almost entirely
non-object oriented. Modular design is what makes a program manageable,
OOP has nothing to do with it. OOP hinders managability to the extent that
it discourages multiple modules performing different functions on the same
data object. In addition, complex inheritance makes it much harder to keep
track of how a change in one data structure or method will effect other
parts of the system.
For your information, I'm a professional Internet protocol designer and
programmer. You're welcome to check out my program, NiftyTelnet
<http://andrew2.andrew.cmu.edu/dist/niftytelnet.html> that I wrote for fun.
For my real job I do much larger and more sophisticated programs all in C.
>OOP and frameworks don't cause bloat. My experience has been somewhat the
>opposite. For example, I recently took an application written in C. I
>totally rewrote it using PowerPlant and C++. I roughly doubled its feature
>set. When I got done I had a more useful program with fewer bugs and a
>more responsive user interface. And how much did I increase the memory
>requirements? None at all. The new program has the same system
>requirements as the old one.
I would claim it was the act of re-writing which resulted in the
improvement. Re-writing (and more importantly re-designing) code from
scratch elmininates all the "feature appendage" bloat.
>Too many
>programmers pay too little attention to memory management. They add
>features as appendages instead of integrating them into a coherent
>architecture as OOP would enable them to do. In short, program bloat
>happens because customers accept it and programmers typically have neither
>the skill nor the incentive to avoid it. After all, memory is getting
>cheaper :-)
I agree, on the condition that you strike the words "as OOP ... to do". A
coherent architecture does not require OOP.
- Chris Newman
+++++++++++++++++++++++++++
>From Joshua C Horan <horan+@andrew.cmu.edu>
Date: Wed, 6 Nov 1996 11:08:02 -0500
Organization: Freshman, MCS Undeclared, Carnegie Mellon, Pittsburgh, PA
>There are several applications that are rather infamous for their
>resource appetite. In some cases such Word 6.0 the reasons seem quite
>obvious, as it contains a port of a half Windows. But what about
>Netscape Navigator 3.0? As it seems it's written using PowerPlant and
>therefore I guess at least somewhat Mac-like -- nevertheless it eats up
>about 9MB of RAM. Why?
>
>Or, looking elsewhere, at the stuff that appears daily on info-mac. I'm
>really astonished by the RAM and disk footprint of some newly written
>applications that only have remarkably few features. Is this the result
>of carelessness? Anyway, we all know that memory (disk/RAM) is cheap? Or
>just a rational decision, as it would have required so much more effort
>to use less resources? What's the place of frameworks (MacApp, TCL,
>PowerPlant) in this game?
>
>Wondering,
Michael
I was just using Netscape 2.02 the other day and it kept complaining
about not having enough memory even with a 9 MB partition! Good thing I
wasn't using 3.0 otherwise it would need 11 MB! Besides who can run 3.0
for more than 3 minutes without discovering it's special "crash or
freeze the computer" feature?
Anyway, I used ZoneRanger to take a look at the Netscape heap and it was
a complete mess! There were pointers all over the place and handles
locked in the middle of the heap. This was the worst memory management
I've seen in a while. Maybe we should inform the Netscape developers
that pointers go at the *bottom* of the heap and that there is this neat
HLockHi() function, or while we're at it how about: DisposePtr(),
HUnlock(), HPurge().
Anyone else feel up to some Netscape Bashing?
Josh Horan
+++++++++++++++++++++++++++
>From Mephisto <mwehner@lander.es>
Date: Tue, 19 Nov 96 16:59:05 -0500
Organization: Lander Internet
Hi!
I just wanted to send some comments regarding C++ programming:
I definitely agree with one fact: large frameworks like the TCL are
*ABSOLUTELY* useless!
I'm using the Symantec Compiler, but I was shocked when I saw how large
applications got with the Visual Architect! (basic size is about 500K!
for just a simple window saying "Hi!")
It is a neat tool, but the size of the compiled projects just is
ridiculous!
But this doesn't mean you have to condemn the whole architecture of C++,
though.
I LOVE it! I think the possiblities of this language are marvellous!
And you don't have to stick to pre-programmed frameworks!
I wrote my own "framework" - and it creates reasonable-sized
applications: the minimum size is about 30K! I don't think you gain that
much by programming in C!
So that's just it - my personal opinion is that C++ has some major
advantages: I don't know about what it does to memory - I guess this IS
a mess sometimes: but if you know how to handle pointers correctly you
can get it under control!
Mephisto (mwehner@lander.es)
+++++++++++++++++++++++++++
>From chrisn+@cmu.edu (Chris Newman)
Date: Mon, 18 Nov 1996 23:48:53 -0800
Organization: Altopia Corp. - Affordable Usenet Access - http://www.alt.net
In article <2931189500@hoult.actrix.gen.nz>, Bruce@hoult.actrix.gen.nz
(Bruce Hoult) wrote:
>> Modular design doesn't require OOP. In fact modular design is often better
>> *without* OOP.
>
>So don't use OOP in those cases. There are other cases where OOP *is* the best
>way to do things.
There are rare cases where OOP is the best way. Windows/Dialogs and
graphic objects come to mind as the cases where it's often useful. Most of
the time OOP is just unnecessary complexity resulting in poor design.
>> And the overhead to manage some of the more complicated inheritance
>> features is very significant.
>
>So if you don't need thos capabilities then don't use those facilities
>and they will cost you nothing. If you *do* want thase capabilities, and
>are using a non-OOP language then you will have a *lot* of tedious manual
>work ahead of you. And probably do it less well than your C++ compiler
>vendor.
Capabilities which require run time support usually bloat the application
even if they're not used. Unless the compiler is exceptionally proficient.
>> Agreed. But I'd go further and say that while good modular design is
>> fairly easy to learn, good object-oriented design is much harder. OOPS is
>> a plot to make programming harder for the average joe.
>
>You've got some sort of a point there. That's why there's Visual Basic for
>the average Joe. OOP was designed by good programmers, to make their own
>work easier. If it doesn't make life easier for poor or average programmers
>-- well, that's too bad, I guess.
Visual Basic is a trap for Microsoft followers with no sense of aesthetics.
:-) OOP is a neat academic idea which is occasionally useful but is
instead promoted as the cure-all to average programmers. There are a lot
more average programmers out there then there are exceptional programmers.
If the average programmers were taught proper modular design instead of the
latest OOP fad, it would make life much easier on the exceptional
programmers who have to clean up the messes left behind.
---------------------------
>From Aegir@www.dma.be (Aegir)
Subject: Writing Netscape Plugins...How ?
Date: 7 Nov 1996 23:40:00 GMT
Organization: ProSoft
Help wanted...
I'm looking for some example code or anyone who can help me with the following :
I want to write (try to write) a Nescape Plugin using CW Pascal.. How do
you do it and where can you find the specs ?
Or does one have to pay for this information ?
All help appreciated.
+++++++++++++++++++++++++++
>From mieczko1@acsu.buffalo.edu (Mark C Mieczkowski)
Date: 8 Nov 1996 16:59:29 GMT
Organization: UB
In article <Aegir-0811960043470001@news.ping.be>,
Aegir <Aegir@www.dma.be> wrote:
>Help wanted...
>
>I'm looking for some example code or anyone who can help me with the following :
>
>I want to write (try to write) a Nescape Plugin using CW Pascal.. How do
>you do it and where can you find the specs ?
>Or does one have to pay for this information ?
>
>All help appreciated.
Check out this month's MacTech! <http://web.xplain.com/mactech.com/>
regards,
+++++++++++++++++++++++++++
>From "Zane H. Healy" <healyzh@ix.netcom.com>
Date: Fri, 08 Nov 1996 01:04:47 -0800
Organization: Netcom
Aegir wrote:
> I'm looking for some example code or anyone who can help me with the following :
> I want to write (try to write) a Nescape Plugin using CW Pascal.. How
I haven't had a chance to read it, but the current issue of MacTech
(Nov) has an article on writing Netscape Plugins (of course it's
probably for C).
Zane
+++++++++++++++++++++++++++
>From Jon Summers <summersjon@s054.aone.net.au>
Date: Tue, 12 Nov 1996 07:50:14 +1000
Organization: Sumware Pty Limited
Pascal?
Hope your good at translating C !
The Netscape SDK is in C and there is a C++ framework
and the latest framework gives you basic Java support.
If you can get your hands on a MacHack 96 CD,
there is source for a Netscape 2/3 & MIE plugin
that does basic QuickTime, including QuickTime VR.
--
Jon Summers
Sumware Pty Limited
summersjon@s054.aone.net.au
+++++++++++++++++++++++++++
>From Online@MacTech.com ( nick.c @MT )
Date: Mon, 18 Nov 1996 19:13:03 -0800
Organization: MacTech Magazine
Have you checked out the November issue of MacTech?
One of the feature articles is about building Netscape
plugins.
____Nicholas C. DeMello, Ph.D.___________________________________________
"MacTech Online"--MacTech Magazine, for Mac OS Programmers and Developers
http://www.MacTech.com/
_/ _/ _/ _/_/_/ _/ _/
Chemistry: Nick@chem.UCLA.edu _/_/ _/ _/ _/ _/ _/_/_/
MacTech: Online@MacTech.com _/ _/_/ _/ _/ _/ _/
http://www.chem.ucla.edu/~nick/ _/ _/ _/_/_/ _/ _/
---------------------------
>From phenix@interpath.com (John Moreno)
Subject: [Q] AppleScript Variable
Date: Tue, 12 Nov 1996 23:44:23 -0500
Organization: phenix@interpath.com
I'd like to share a variable between two script files. Does anybody
have any examples of this? Or how to get one script to call the
function in another. Any help would be appreciated.
--
John Moreno
+++++++++++++++++++++++++++
>From js12@gte.com (John Schettino)
Date: Thu, 14 Nov 1996 13:51:47 -0400
Organization: GTE Laboratories, Inc.
In article <199611122344238208401@roxboro-186.interpath.net>,
phenix@interpath.com (John Moreno) wrote:
> I'd like to share a variable between two script files. Does anybody
> have any examples of this? Or how to get one script to call the
> function in another. Any help would be appreciated.
You can call a handler in another running script by using tell - you can
also access properties in another running script using tell or a property
reference:
Script a, saved as a stay-open application
property myValue : 100
on doSomethingA(theString)
display dialog "A was told to " & theString
end doSomethingA
on incrementA()
set myValue to myValue + 1
end incrementA
- ---
Script b, saved as a stay-open application
on run
tell application "a" to activate -- start a
activate
local aval
tell application "a"
set aval to application "a"'s myValue
end tell
display dialog "A's myValue is: " & aval
tell application "a" to incrementA()
tell application "a" to activate -- start a
tell application "a" to doSomethingA("say this!")
activate
display dialog "A's myValue is: " & aval -- note old value
set aval to myValue of application "a" -- property reference
display dialog "A's myValue is: " & aval -- now new value
end run
==--
John Schettino
HomePage: http://members.aol.com/pdcjohns
+++++++++++++++++++++++++++
>From phenix@interpath.com (John Moreno)
Date: Sat, 16 Nov 1996 11:08:20 -0500
Organization: phenix@interpath.com
John Schettino <js12@gte.com> wrote:
] In article <199611122344238208401@roxboro-186.interpath.net>,
] phenix@interpath.com (John Moreno) wrote:
]
] > I'd like to share a variable between two script files. Does anybody
] > have any examples of this? Or how to get one script to call the
] > function in another. Any help would be appreciated.
]
] You can call a handler in another running script by using tell - you
] can also access properties in another running script using tell or a
] property reference:
-snip code-
Ok, thanks. But I didn't think the other script had to be running at
the time, so I have another question - How can I get script a, the one
saved as stay-open application, to quit?
Also do you have any recommendations for a good AppleScript programming
book?
--
John Moreno
+++++++++++++++++++++++++++
>From js12@gte.com (John Schettino)
Date: Mon, 18 Nov 1996 15:13:49 -0400
Organization: GTE Laboratories, Inc.
In article <199611161108202604576@roxboro-188.interpath.net>,
phenix@interpath.com (John Moreno) wrote:
> John Schettino <js12@gte.com> wrote:
>
> ] In article <199611122344238208401@roxboro-186.interpath.net>,
> ] phenix@interpath.com (John Moreno) wrote:
> ]
> ] > I'd like to share a variable between two script files. Does anybody
> ] > have any examples of this? Or how to get one script to call the
> ] > function in another. Any help would be appreciated.
> ]
> ] You can call a handler in another running script by using tell - you
> ] can also access properties in another running script using tell or a
> ] property reference:
>
> -snip code-
>
>
> Ok, thanks. But I didn't think the other script had to be running at
> the time, so I have another question - How can I get script a, the one
> saved as stay-open application, to quit?
tell application "a" to quit
>
> Also do you have any recommendations for a good AppleScript programming
> book?
Ahem... I happen to have written one on AppleScript and FaceSpan (see my
home page http://members.aol.com/pdcjohns)
My book aside, you need to download Apple's AppleScript language guide
english dialect from the Apple developer ftp site. Danny Goodman's
AppleScript Handbook is good, too. Check out
http://applescript.infovista.com/ for lots of applescript info and book
listings (specifically
http://applescript.infovista.com/as/support.html#books)
==--
John Schettino
HomePage: http://members.aol.com/pdcjohns
---------------------------
>From masunta@news.siba.fi (Miika Asunta)
Subject: [Q] Difference between MOVE.L and MOVEA.L
Date: 18 Nov 1996 00:38:37 +0200
Organization: Sibelius Academy, Helsinki
What's the difference between 68000 assembler instructions
MOVE.L and MOVEA.L?
--
Miika Asunta Double Bass Player
Miika.Asunta@siba.fi Macintosh Programmer
tel. +358-0-7374 89
GSM: +358-40-5477 842 http://www.siba.fi/~masunta
+++++++++++++++++++++++++++
>From jwwalker@millennianet.com (James W. Walker)
Date: Sun, 17 Nov 1996 16:19:53 -0800
Organization: Nisus Software, Inc.
In article <56o45d$ff3@amadeus.siba.fi>, masunta@news.siba.fi (Miika
Asunta) wrote:
>What's the difference between 68000 assembler instructions
>MOVE.L and MOVEA.L?
In MOVEA.L, the destination of the move is an address register.
--
-- Jim Walker <http://members.aol.com/jwwalker/>
+++++++++++++++++++++++++++
>From steve@brecher.reno.nv.us (Steve Brecher)
Date: Sun, 17 Nov 1996 22:27:45 -0800
Organization: none, in Reno NV USA
masunta@news.siba.fi (Miika Asunta) wrote:
> What's the difference between 68000 assembler instructions
> MOVE.L and MOVEA.L?
Move.L moves a 32-bit value to a data register or to memory, sets the N and Z
condition codes to reflect the data moved and clears the V and C condition
codes.
MoveA.L moves a 32-bit value to an address register; the condition
codes are not affected.
--
steve@brecher.reno.nv.us (Steve Brecher)
---------------------------
>From hooty@odyssee.net (Eric Dorland)
Subject: [Q] Hiding Applications
Date: Sun, 10 Nov 1996 16:46:22 -0400
Organization: Odyssee Internet
How do you find out if application is hidden (From using one of the hide
commands from the application menu) and how do you hide an application
from your code?
Eric Dorland
hooty@odyssee.net
http://www.odyssee.net/~hooty/
+++++++++++++++++++++++++++
>From zobkiw@triplesoft.com (Joe Zobkiw)
Date: Mon, 11 Nov 1996 07:37:20 -0500
Organization: TripleSoft Inc.
In article <hooty-1011961646220001@news.odyssee.net>, hooty@odyssee.net
(Eric Dorland) wrote:
> How do you find out if application is hidden (From using one of the hide
> commands from the application menu) and how do you hide an application
> from your code?
The Process Manager can help you.
<http://devworld.apple.com/dev/techsupport/insidemac/Processes/Processes-2.html>
- -----------------------------------------------------------
Joe Zobkiw <mailto:zobkiw@triplesoft.com>
TripleSoft Inc. <http://www.triplesoft.com/>
Macintosh Software Development & Internet Publishing Services
- -----------------------------------------------------------
Macintosh Programmers: <http://www.triplesoft.com/fragment/>
Macintosh WebMasters: <http://www.triplesoft.com/screenview/>
Personal Page: <http://www.triplesoft.com/zobintosh/>
+++++++++++++++++++++++++++
>From hooty@odyssee.net (Eric Dorland)
Date: Tue, 12 Nov 1996 19:09:35 -0400
Organization: Odyssee Internet
In article <zobkiw-ya023180001111960737200001@client.news.psi.net>,
zobkiw@triplesoft.com (Joe Zobkiw) wrote:
> In article <hooty-1011961646220001@news.odyssee.net>, hooty@odyssee.net
> (Eric Dorland) wrote:
>
> > How do you find out if application is hidden (From using one of the hide
> > commands from the application menu) and how do you hide an application
> > from your code?
>
> The Process Manager can help you.
>
>
<http://devworld.apple.com/dev/techsupport/insidemac/Processes/Processes-2.html>
>
Actually, I can't find anything in IM: Processes about hiding applications
Eric Dorland
hooty@odyssee.net
http://www.odyssee.net/~hooty/
+++++++++++++++++++++++++++
>From hooty@odyssee.net (Eric Dorland)
Date: Wed, 13 Nov 1996 21:19:35 -0400
Organization: Odyssee Internet
In article
<samizdat-1311961139270001@pool002-max5.la-ca-us.dialup.earthlink.net>,
samizdat@earthlink.net (Chris Kelly) wrote:
Is there an official way, using the Process manager or Apple Events?
> If you can't find a better way, two skanky hacks I can think of are:
>
> 1. Use the undocumented Layer Manager, information on which can be found
> in old Info Mac digests.
>
> 2. Use SystemMenu( 0xBF970001 ) or simulate an option-click on the desktop to
> hide the front app.
Eric Dorland
hooty@odyssee.net
http://www.odyssee.net/~hooty/
+++++++++++++++++++++++++++
>From Bill Hubauer <hubauer@nauticom.net>
Date: 14 Nov 96 13:31:44 GMT
Organization: Power On Software
In article <zobkiw-ya023180001111960737200001@client.news.psi.net> Joe
Zobkiw, zobkiw@triplesoft.com writes:
>> How do you find out if application is hidden (From using one of the hide
>> commands from the application menu) and how do you hide an application
>> from your code?
>
>The Process Manager can help you.
>
For those of you who do not know, Joe is a very smart guy who is usually
right on the money
with his answers, but I don't think he had his coffee this morning ;-)
The process manager doesn't really have any part of controling an
applications visible/hidden state (as there is no public interface for
that
in processes.h). The visible state is controled by the mythical "Layer
Manager",
which is, I suppose, really part of the process manager (multifinder)
portion of
the system software.
The Layer Manager was not made available for programmers to use (there is
no public API).
There was a good reason for this, it is a gross hack. Even though I call
it a
"Gross Hack", it is, none the less, a tribute to the ingenuity of the
some really sharp mac developers...
There is lots to say about the Layer Manager but unless someone really
wants to
know, I'd just as soon not talk about it. There was a header file
called "Layers.h" floating around the net a while back that would provide
you with a way to hide and show application layers...
The closest thing to a "legit" way to hide an application
is to bring it to the front with "SetFrontProcess" and then
call SystemMenu to fake a menu selection of "Hide <front app name>"
from the process menu. I don't know if any legit way to
tell if a process is hidden, although you can do that with
the "Layers.h" file I was talking about.
Bill Hubauer
Power On Software
+++++++++++++++++++++++++++
>From samizdat@earthlink.net (Chris Kelly)
Date: Wed, 13 Nov 1996 11:39:27 -0800
Organization: Samizdat Productions
If you can't find a better way, two skanky hacks I can think of are:
1. Use the undocumented Layer Manager, information on which can be found
in old Info Mac digests.
2. Use SystemMenu( 0xBF970001 ) or simulate an option-click on the desktop to
hide the front app.
Chris Kelly
samizdat@earthlink.net
http://home.earthlink.net/~samizdat
In article <hooty-1211961909350001@news.odyssee.net>, hooty@odyssee.net
(Eric Dorland) wrote:
> In article <zobkiw-ya023180001111960737200001@client.news.psi.net>,
> zobkiw@triplesoft.com (Joe Zobkiw) wrote:
>
> > In article <hooty-1011961646220001@news.odyssee.net>, hooty@odyssee.net
> > (Eric Dorland) wrote:
> >
> > > How do you find out if application is hidden (From using one of the hide
> > > commands from the application menu) and how do you hide an application
> > > from your code?
> >
> > The Process Manager can help you.
> >
> >
>
<http://devworld.apple.com/dev/techsupport/insidemac/Processes/Processes-2.html>
> >
>
> Actually, I can't find anything in IM: Processes about hiding applications
>
> Eric Dorland
> hooty@odyssee.net
> http://www.odyssee.net/~hooty/
+++++++++++++++++++++++++++
>From jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
Date: 13 Nov 1996 22:23:08 GMT
Organization: Queen Mary & Westfield College, London, England
In article <hooty-1211961909350001@news.odyssee.net>
hooty@odyssee.net (Eric Dorland) writes:
> In article <zobkiw-ya023180001111960737200001@client.news.psi.net>,
> zobkiw@triplesoft.com (Joe Zobkiw) wrote:
>
> > In article <hooty-1011961646220001@news.odyssee.net>, hooty@odyssee.net
> > (Eric Dorland) wrote:
> >
> > > How do you find out if application is hidden (From using one of the hide
> > > commands from the application menu) and how do you hide an application
> > > from your code?
> >
> > The Process Manager can help you.
> >
> >
> <http://devworld.apple.com/dev/techsupport/insidemac/Processes/Processes-2.html>
> >
>
> Actually, I can't find anything in IM: Processes about hiding applications
I think that's because there's nothing there.
Hiding is done by the Layer Manager. Its API isn't officially
documented and Apple has said that if you use it, they'll send the boys
round in the middle of the night to smash your windows and let down
your car tyres.
However, there are ways round the problem. First, you can find the API,
which some brave souls have documented, and use it (having first
installed bullet-proof glass and locked your garage).
Alternatively, and probably rather less likely to break in the future,
you can hide and show processes by asking the Finder to do it for you.
tell application "Finder"
set the visible of process "eric" to false
end tell
of course, if you want to hide the finder itself, you need something
slightly different
tell application "Finder"
set visible to false
end tell
Good luck!
Jeremy
+++++++++++++++++++++++++++
>From jonpugh@frostbitefalls.com (Jon Pugh)
Date: Fri, 15 Nov 1996 23:08:02 -0800
Organization: Whatsa Madda U.
In article <hooty-1311962119350001@news.odyssee.net>, hooty@odyssee.net
(Eric Dorland) wrote:
>Is there an official way, using the Process manager or Apple Events?
Apple events are the official way. You can send events to the Finder
fairly easily if you are willing to use some tricks. I've included sample
code for just these functions (i.e finding hidden apps) in my Jon's
Commands scripting addition:
ftp://ftp.infoworkshop.com/%2Fpublic/JonPugh/JonsCommands.sit.hqx
Good luck.
Jon
--
What are YOU doing to oppose the Microsoft juggernaut?
http://www.infoworkshop.com/~jonpugh/
+++++++++++++++++++++++++++
>From Online@MacTech.com ( nick.c @MT )
Date: Mon, 18 Nov 1996 11:54:14 -0800
Organization: MacTech Magazine
Jeremy & Chris,
This questions seems to get asked and answered about
every three months. Has anyone sent the answer in
to the MacTech "tips & tidbits" section yet? If
not, think about it. MacTech pays hard cash for
neat tricks... Steve Sisak is the Tips columnist
and can be contacted at <tips@mactech.com>.
__hooty@odyssee.net (Eric Dorland) wrote_______________________________
>> > > How do you find out if application is hidden (From using one of the hide
>> > > commands from the application menu) and how do you hide an application
>> > > from your code?
__samizdat@earthlink.net (Chris Kelly) wrote___________________________
>If you can't find a better way, two skanky hacks I can think of are:
>
>1. Use the undocumented Layer Manager, information on which can be found
>in old Info Mac digests.
>
>2. Use SystemMenu( 0xBF970001 ) or simulate an option-click on the desktop to
>hide the front app.
>
>Chris Kelly
>samizdat@earthlink.net
>http://home.earthlink.net/~samizdat
__jeremyr@dcs.qmw.ac.uk (Jeremy Roussak) wrote__________________________
>Hiding is done by the Layer Manager. Its API isn't officially
>documented and Apple has said that if you use it, they'll send the boys
>round in the middle of the night to smash your windows and let down
>your car tyres.
>
>However, there are ways round the problem. First, you can find the API,
>which some brave souls have documented, and use it (having first
>installed bullet-proof glass and locked your garage).
>
>Alternatively, and probably rather less likely to break in the future,
>you can hide and show processes by asking the Finder to do it for you.
>
>tell application "Finder"
> set the visible of process "eric" to false
>end tell
>
>of course, if you want to hide the finder itself, you need something
>slightly different
>
>tell application "Finder"
> set visible to false
>end tell
>
>Good luck!
>
>Jeremy
____Nicholas C. DeMello, Ph.D.___________________________________________
"MacTech Online"--MacTech Magazine, for Mac OS Programmers and Developers
http://www.MacTech.com/
_/ _/ _/ _/_/_/ _/ _/
Chemistry: Nick@chem.UCLA.edu _/_/ _/ _/ _/ _/ _/_/_/
MacTech: Online@MacTech.com _/ _/_/ _/ _/ _/ _/
http://www.chem.ucla.edu/~nick/ _/ _/ _/_/_/ _/ _/
---------------------------
>From srw@zanshin.com (Steve R Webster)
Subject: [Q] How to tell if you're "hidden"?
Date: Thu, 14 Nov 1996 13:02:04 -0800
Organization: Zanshin Software Inc.
Hi-
Anyone know how to determine whether your application's windows have
been "hidden" via the "Hide" item in the Application menu?
I need to be able to determine the structure rect of my windows while
they've been hidden in this manner. The problem is, GrafPtr->visible is
true while a window's hidden this way, but the content and structure rects
are trash.
thanks,
-steve
---------------------------
>From jsoltys@woodinville.com (John Soltys)
Subject: [Q] forcing updateEvts & turning a font question
Date: Thu, 14 Nov 1996 01:11:52 -0800
Organization: The Edwards Agency
How can I force an updateEvt to cause the Event Manager to redraw a window?
Additionally, is it possible to take a font family id, turn it into text,
and match it against a menu? I want to check the system font in a menu,
but can't seem to figure out how to get the item number.
+++++++++++++++++++++++++++
>From gga@it.ntu.edu.au (Giles Alexander)
Date: 14 Nov 1996 10:09:20 GMT
Organization: Northern Territory University
John Soltys (jsoltys@woodinville.com) wrote:
: How can I force an updateEvt to cause the Event Manager to redraw a window?
Call InvalRect() giving the rectangle of the window that you want to redraw.
I think there is also an InvalRgn() function. Both of these tell the window
manager that some part of the window needs to be redrwan. An update event
will be generated.
Regards,
Giles Alexander
--
giles@kagi.com | If builders built buildings the way
| programmers write programs, the
Check out Note: | first woodpecker that comes along
http://www.ozemail.com.au/~notesoft/ | would destroy all of civilisation.
+++++++++++++++++++++++++++
>From SouthSide@kagi.com (Bob Bradley)
Date: Thu, 14 Nov 1996 20:00:59 -0800
Organization: SPC
In article <jsoltys-1411960111520001@ppp-2-122.connect.com>,
jsoltys@woodinville.com (John Soltys) wrote:
> How can I force an updateEvt to cause the Event Manager to redraw a window?
Set the port to the window you want to redraw and call InvalRect or
InvalRgn with the area of the window you want to redraw.
> Additionally, is it possible to take a font family id, turn it into text,
> and match it against a menu? I want to check the system font in a menu,
> but can't seem to figure out how to get the item number.
If you have the name of a font, you can search the font menu for that name
to get it's item number. Use a binary search since the font menu is
sorted.
+++++++++++++++++++++++++++
>From kurisuto@babel.ling.upenn.edu (Sean Crist)
Date: 14 Nov 1996 13:48:47 GMT
Organization: University of Pennsylvania
In article <jsoltys-1411960111520001@ppp-2-122.connect.com>,
John Soltys <jsoltys@woodinville.com> wrote:
>How can I force an updateEvt to cause the Event Manager to redraw a window?
As someone else already said, you call InvalRect.
>Additionally, is it possible to take a font family id, turn it into text,
>and match it against a menu? I want to check the system font in a menu,
>but can't seem to figure out how to get the item number.
Yes. First you call GetFontName(MyFontName, 0) to get the name of the
system font. Then you loop through all the menu items in your font menu
until you match that name. This is my generic routine for the matching,
which takes a menu and font name as its input and gives the number of the
menu item as output:
function FindFontMenuItemByName (TheMenu: MenuHandle; TheName: Str255):
Integer;
var
counter: Integer;
ItemTitle: Str255;
begin
FindFontMenuItemByName := -1;
for counter := 1 to CountMItems(TheMenu) do
begin
GetItem(TheMenu, counter, ItemTitle);
if EqualString(TheName, ItemTitle, FALSE, FALSE) then
FindFontMenuItemByName := counter;
end;
end;
\/ __ __ _\_ --Sean Crist (kurisuto@unagi.cis.upenn.edu)
--- | | \ / For a free copy of the Bill of Rights, finger
_| ,| ,| ----- this account. It's also available through
_| ,| ,| [_] my homepage:
| | | [_] http://www.ling.upenn.edu/~kurisuto/
---------------------------
>From msbishop@ix.netcom.com (Matt Bishop)
Subject: cicn-ICON conundrum (cicn != 32x32 == UGLY!)
Date: Wed, 13 Nov 1996 13:22:42 -0500
Organization: Zippo
I am attempting to use a color icon in a dialog box. Following the
rules, I create an ICON resource (ID 1000--found that one!) and then a
cicn resource with the same ID. Using ResEdit I put an icon item in a
dialog and give it the icon resource 1000. This all works fine.
NOW--when I change the size of the cicn to 16x16, the dialog displays a
box of garbage instead of my nicely cropped cicn. (I haven't figured out
how to crop an ICON; my guess is you can't.)
Please tell me this isn't so. I want to line up several icons in a row
(like a tool box) and I don't want to have to overlap 32x32 icon items!
--
Matt Bishop
msbishop@ix.netcom.com
+++++++++++++++++++++++++++
>From BHuey@worldnet.att.net (Hugh Johnson)
Date: Wed, 13 Nov 1996 23:48:29 -0500
Organization: AT&T WorldNet Services
In article <msbishop-1311961322420001@news.zippo.com>,
msbishop@ix.netcom.com (Matt Bishop) wrote:
> I am attempting to use a color icon in a dialog box. Following the
> rules, I create an ICON resource (ID 1000--found that one!) and then a
> cicn resource with the same ID. Using ResEdit I put an icon item in a
> dialog and give it the icon resource 1000. This all works fine.
>
> NOW--when I change the size of the cicn to 16x16, the dialog displays a
> box of garbage instead of my nicely cropped cicn. (I haven't figured out
> how to crop an ICON; my guess is you can't.)
>
> Please tell me this isn't so. I want to line up several icons in a row
> (like a tool box) and I don't want to have to overlap 32x32 icon items!
>
Using old-fashioned icons with cicn's of the same ID is the only way to
remain backward-compatible with straight 68000 Macs, I think. So that's
what's hampering you - black&white compatibility.
If you don't care about that compatibility, then what you should do is,
instead of putting icons in your DITL, just put userItems instead. At
run-time, just get your cicn handles and use PlotCIcon() (I think that's
what it's called?) into the userItem Rects in response to update events.
Actually, I think this would still be backward-compatible, because your
cicn's will have the black&white versions right in them.
--
The universe is a figment of it's own imagination.
+++++++++++++++++++++++++++
>From dstone@chem.utoronto.ca (David Stone)
Date: Fri, 15 Nov 1996 17:40:04 GMT
Organization: University of Toronto Chemistry
In article
<BHuey-1311962348290001@94.minnesota-002.mn.dial-access.att.net>,
BHuey@worldnet.att.net (Hugh Johnson) wrote:
[snip]
>
> If you don't care about that compatibility, then what you should do is,
> instead of putting icons in your DITL, just put userItems instead. At
> run-time, just get your cicn handles and use PlotCIcon() (I think that's
> what it's called?) into the userItem Rects in response to update events.
>
> Actually, I think this would still be backward-compatible, because your
> cicn's will have the black&white versions right in them.
>
Only if the B&W Mac in question is running system 7.x - PlotCIcon()
is not implemented otherwise.
Dave Stone
---------------------------
>From mcovel@cais.com
Subject: mac batch file conversion
Date: Sat, 16 Nov 1996 12:53:42 -0500
Organization: Posted via CAIS Internet <info@cais.com>
Anyone have a rec. for mac batch file conversion. ie. from one application
to another, word to BBedit for ex.
Assistance or advice is appreciated.
Mike
mcovel@cais.com
+++++++++++++++++++++++++++
>From macwannabe@mac.land.com (MacWannaBe)
Date: Sun, 17 Nov 1996 19:14:32 GMT
Organization: Indigo
On Sat, 16 Nov 1996 12:53:42 -0500, mcovel@cais.com wrote:
>Anyone have a rec. for mac batch file conversion. ie. from one application
>to another, word to BBedit for ex.
>
>Assistance or advice is appreciated.
>
>Mike
>
>mcovel@cais.com
try MacLink Plus 8.1 from DataViz - it uses XTND filters to convert
from one format to another - and can be accessed from any program that
supports XTND (ClarisWorks, BBEdtit, etc) and also has a stand alone
Document Converter application - which lets you choose from what
format to convert from and to what format you want to convert to.
+++++++++++++++++++++++++++
>From andyb@apple.com (Andy Bachorski)
Date: Mon, 18 Nov 1996 17:28:59 -0800
Organization: Apple Computer, Inc.
Two applications come to mind. File Buddy, and File Typer. Both offer a
drag & drop interface for changing many file attributes, including file
type and creator codes, Finder flags etc. File Buddy will also change
dates, while File Typer allows you to create small applets that perform a
perconfigured change on files dropped on it. Both are available at your
favorite archive site.
Andy B
In article <mcovel-1611961253420001@mcovel.cais.com>, mcovel@cais.com wrote:
> Anyone have a rec. for mac batch file conversion. ie. from one application
> to another, word to BBedit for ex.
>
> Assistance or advice is appreciated.
>
> Mike
>
> mcovel@cais.com
+++++++++++++++++++++++++++
>From Jason J Mullins <jasonm@mcqueen.com>
Date: Mon, 18 Nov 1996 10:01:18 +0000
Organization: McQueen
mcovel@cais.com wrote:
>
> Anyone have a rec. for mac batch file conversion. ie. from one application
> to another, word to BBedit for ex.
Adobe do a product for Mac and Windows called Adobe File Utilities,
which is basically Word for Word translators and which can do batch
translations. I don't imagine that it will convert to BBedit, but on the
other hand BBedit can just open pure text, so there would be no
problems.
Try http://www.adobe.com/prodindex/fileutilities/main.html
J.
---------------------------
>From lalo7475@saintmarys.edu
Subject: scrolling game help
Date: 8 Nov 1996 14:41:00 GMT
Organization: Deja News Usenet Posting Service
I'm trying to make an adventure game that scrolls from left to
right and top to bottum. I'm hard coding and array of about
100 by 140 of 32by32(pixel)tiles. onl about 15 by 20 fit
in my window. I want to make it so when the player goes from
one side of the screen (like the left) he would come out on the
other(the right, in this case) with that part of the world now the
tiles to be drawn in the window so my player can walk throw his whole
world. Does anyone know how I can do this?
I have everything else to this game figured out but this. I know it
should be easy but I've never seen how it's done and never made a
games world exceed the top of my screen. Would appreciate all the
help I can get.
Thanks
Frank La Lone
- ---------------------------------------------------------------------
This article was posted to Usenet via the Posting Service at Deja News:
http://www.dejanews.com/ [Search, Post, and Read Usenet News!]
+++++++++++++++++++++++++++
>From s@w.nl (e)
Date: Tue, 12 Nov 1996 23:28:20 +0100
Organization: e
In article <847462119.13926@dejanews.com>, lalo7475@saintmarys.edu wrote:
> I'm trying to make an adventure game that scrolls from left to
> right and top to bottum. I'm hard coding and array of about
> 100 by 140 of 32by32(pixel)tiles. onl about 15 by 20 fit
> in my window. I want to make it so when the player goes from
> one side of the screen (like the left) he would come out on the
> other(the right, in this case) with that part of the world now the
> tiles to be drawn in the window so my player can walk throw his whole
> world. Does anyone know how I can do this?
> I have everything else to this game figured out but this. I know it
> should be easy but I've never seen how it's done and never made a
> games world exceed the top of my screen. Would appreciate all the
> help I can get.
> Thanks
> Frank La Lone
> -----------------------------------------------------------------------
> This article was posted to Usenet via the Posting Service at Deja News:
> http://www.dejanews.com/ [Search, Post, and Read Usenet News!]
hi
check out the new version of SpriteWorld, they implemented a scrolling
engine which does quite exactly what you want if i understood it correctly.
regards
sebastian
+++++++++++++++++++++++++++
>From lalo7475@saintmarys.edu
Date: Tue, 19 Nov 1996 00:31:07 -0600
Organization: Deja News Usenet Posting Service
Thanks a million I found a "SpriteWorld 2" I think it has every
thing that I need to it. Awesome code for my needs. Thanks a lot.
Frank La Lone
> > -----------------------------------------------------------------------
> > This article was posted to Usenet via the Posting Service at Deja News:
> > http://www.dejanews.com/ [Search, Post, and Read Usenet News!]
> hi
> check out the new version of SpriteWorld, they implemented a scrolling
> engine which does quite exactly what you want if i understood it correctly.
> regards
> sebastian
>
- ---------------------------------------------------------------------
This article was posted to Usenet via the Posting Service at Deja News:
http://www.dejanews.com/ [Search, Post, and Read Usenet News]
---------------------------
>From gnaegy@inanna.com (John Gnaegy)
Subject: where find routines for MacTCP connections?
Date: Fri, 15 Nov 1996 18:13:17 -0600
Organization: Inanna
I've got the Open Transport SDK, but I want to write a really simple
little app that'll work on machines using either Open Transport OR
MacTCP. Apple's so gung-ho about Open Transport that I can't seem to find
anything resembling a MacTCP SDK on Apple's dev site.
If I use the OT SDK to write a little bot, will it work on machines using
MacTCP? (I'm guessing no, right?)
Is there a library included in to the regular Mac headers that either does
specifically MacTCP connections, or just handles connections regardless of
which networking environment is in use? If so, what's it called (like
strings.c, textututils.c, etc)?
To give you an idea of the simplicity involved, the app will just
periodically ping an IP address. If it can't ping the address, or the
ping time is really long, then it launches another app. I'm using
Codewarrior.
John
gnaegy@inanna.com
Inanna Design & Storage www.inanna.com
+++++++++++++++++++++++++++
>From bill@scconsult.com (Bill Stewart-Cole)
Date: Sat, 16 Nov 1996 21:06:09 -0600
Organization: ZOG
In article <gnaegy-1511961813170001@mama.inanna.com>, gnaegy@inanna.com
(John Gnaegy) wrote:
>I've got the Open Transport SDK, but I want to write a really simple
>little app that'll work on machines using either Open Transport OR
>MacTCP. Apple's so gung-ho about Open Transport that I can't seem to find
>anything resembling a MacTCP SDK on Apple's dev site.
Try ftp.seeding.apple.com. I believe the MacTCP SDK is still there.
CodeWarrior ships withthe MacTCP.h header, which rolls together all the
older headers. (it also has stubs of the old headers that just #include
MacTCP.h) The 'meat' of MacTCP is simply the .ipp driver that MacTCP
installs. The calls all go through the standard driver mechanism.
However, some of the best sample code for MacTCP is not in the SDK, it is
in the source for NewsWatcher. This is available at
ftp://ftp.acns.nwu.edu/pub/newswatcher/ and unlike the sort of sample code
one finds in an SDK, this is well-tested code built for re-use and
implemented for a real application. It also shows a good example of
side-by-side implementation of MacTCP and OT TCP/IP.
--
Bill Stewart-Cole
---------------------------
End of C.S.M.P. Digest
**********************